Element tag

The WebSphere Commerce element tag tracks customer interactions with content within a page, or intrapage elements. In WebSphere Commerce starter stores, these elements include the product fast finder, and the faceted navigation on category and search result pages. Other examples of elements include search and news portlets, video plays, and Ajax detail hovers for products or customer reviews.

The element tag does not generate any data on its own. For this tag, you must use the tag parameters to pass in the data you want to collect. This tag can also pass extra parameters for tag customization.

Parameters

The following is a list of required and optional parameters for the element tag.

Note for IBM Digital Analytics: The following parameters are for the WebSphere Commerce <cm:element /> tag. This tag generates the IBM Digital Analytics cmCreateElementTag data tag.

elementId
A required parameter that specifies an identifier for the element with which a customer is interacting. This should be a distinct name for the element, such as Product Fast Finder.
category
An optional parameter that specifies the category of the particular element.
pageId
An optional parameter that specifies the ID of the page on which the element is located. By default, the pageId is used as the title of the page.
pageCategory
An optional parameter that specifies the category of the page on which the element is located.
location
An optional parameter that specifies the location of the element on the page, for example, top navigation or sidebar.
storeId
An optional parameter that is the store ID of the store to which the page currently being viewed belongs. If you do not include this parameter, the storeId value is extracted from the current URL.
extraparms
An optional parameter that communicates more information to the external analytics system. This parameter is provided for cases in which you might have negotiated with the external analytics vendor to generate some custom report that requires more information.

Note for IBM Digital Analytics: Use the extraparms parameter to pass either IBM Digital Analytics Explore attributes, or data for custom IBM Digital Analytics reports, or both. See Passing extra data to IBM Digital Analytics with the extraparms parameter.

There are multiple ways to pass values by using the extraparms parameter:
Description Example
Specify explicit values as properly escaped JavaScript. To pass more than one value, separate values with a comma. extraparms="\"value1\",\"value2\""
Specify explicit values without escaping the values. To pass more than one value, separate values with a comma. extraparms="value1,value2"
returnAsJSON
An optional parameter that is designed for use when tracking customer interactions that do not cause a full page refresh. For example, in a Web 2.0 store, the customer might interact with the mini shopping cart, the Product Fast Finder, or a wish list. To track these intrapage interactions, you can use this parameter to return a JSON object instead of generating the analytics data tag. When the Web 2.0 store tagging framework detects that this analytics event has occurred, the tagging framework can use the JSON object to populate the analytics data tag. Valid values are:
  • true = Return a JSON object.
  • false = Generate the analytics data tag.
The following is the JSON data structure for the element tag:
[{elementId:"ELEMENTID",category:"CATEGORY",pageId:"PAGEID",
pageCategory:"PGCATEGORY",location:"LOCATION"'}]

Tag versions

WebSphere Commerce provides two versions of the element tag:

  1. An abstract base tag implementation class: com.ibm.commerce.bi.taglib.ElementBaseTag. Analytics vendors who want to provide an element tag in their web analytics JSP tag library for WebSphere Commerce can extend this base tag class and implement their own logic to generate the vendor-specific element tagging APIs.
  2. A default implementation of the element tag (<cm:element />) for IBM Digital Analytics. This implementation automatically generates the IBM Digital Analytics cmCreateElementTag data tag.