Add isactivedatacontext Tags

To collect active data on the deepest (most specific) category being browsed on the page, you must place the <isactivedatacontext> tag somewhere within the <head> or <body> tags of each site page where <script> tags are valid. The best location is wherever the category context of the site is most prominently indicated to the storefront customer, such as breadcrumbs that are rendered that show the current category.

Best practice: Include this tag in exactly one template used to make up each HTML page. If this tag appears in multiple templates used to make up a single HTML page, the latest template takes precedence. For example, if one tag indicates the Hats category, and a later tag indicates the Socks category, the Socks category takes precedence. There is no negative effect if the tag appears in multiple templates with the same category value for the same HTML page, but it's redundant. If this tag doesn't appear in any templates that are used to make up an HTML page, no category context is associated with the page.

The specified category is also associated with data collected in the page about products.


If the optional categoryID attribute of ProductLineItem is set, then Salesforce B2C Commerce uses that category instead of the category specified by the isactivedatacontext tag to update the topCategoriesOrdered field.

The following table shows how this feature is implemented in SiteGenesis:

Template Tag example
components/productbreadcrumbs_left_directcategory.isml <isactivedatacontext category="${category}">
components/productbreadcrumbs.isml <isactivedatacontext category="${category}">
search/components/productsearchbreadcrumbs.isml <isactivedatacontext category="${pdict.ProductSearchResult.category}">
X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used. By continuing to use this site you are giving us your consent to do this. Privacy Policy.