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 /global/gadgets/metaDetails.jsp
gadget, which is invoked through the cpb:pageContainer
tag. For example:
<cbp:pageContainer> <jsp:attribute name="SEOTagRenderer"> <dsp:include page="/global/gadgets/metaDetails.jsp" flush="true"> <dsp:param name="catalogItem" param="product"/> </dsp:include> </jsp:attribute> </cbp: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 using only values stored in the SEORepository
. Using the request URI of the current request as the key, it looks up the corresponding SEOTags
map item and uses the values of its properties to construct the tags.
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.