Web search engines base their rankings of pages partly on the words that appear in certain HTML tags, particularly <meta> tags and the <title> tag. A common SEO technique is to list key search terms in those tags, to raise the ranking of the pages for those terms.

Commerce Reference Store pages include logic for rendering <title>, <meta name=description ...>, and <meta name=keywords ...> tags. This logic is found in the store.war/global/gadgets/metaDetails.jsp gadget, which is invoked through the <crs:pageContainer> tag. For example:

<crs:pageContainer>
    <jsp:attribute name="SEOTagRenderer">
      <dsp:include page="/global/gadgets/metaDetails.jsp" flush="true">
        <dsp:param name="catalogItem" param="product" />
      </dsp:include>
    </jsp:attribute>
</crs:pageContainer>

Depending on the context, the gadget can be invoked either with or without the catalogItem parameter. If the catalogItem parameter is omitted, metaDetails.jsp renders the tags based only on values stored in the SEORepository. Using the servlet path of the current request to look up the key property, and the site ID of the current site to look up the sites property, it finds the correct SEOTags item. It then uses the values of this item’s description, keywords, and title properties to construct the <meta> tags and the <title> tag.

If the catalogItem parameter is included, metaDetails.jsp renders the tags by combining the values stored in the repository with values taken from the item’s properties. For example, if the item is a product, the <meta name=description ...> tag is constructed by concatenating the description property of the SEOTags item with the longDescription property of the product.