Product tag

The WebSphere Commerce product tag collects details about the products a customer has viewed.

This tag collects the following data to pass to an external analytics system:

  • Page name
  • Product part number
  • Product name
  • Product category in the catalog the customer is currently browsing
  • Product category in the master catalog
  • Store identifier

This tag can also pass extra parameters for tag customization.

Parameters

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

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

To pass the product data that is previously listed to an external analytics system, use one of the following two parameters:

databean
Use this parameter if your product display page contains a product-related data bean. This parameter is a populated instance of either a com.ibm.commerce.catalog.beans.ProductDataBean, an com.ibm.commerce.catalog.beans.ItemDataBean, a com.ibm.commerce.catalog.beans.BundleDataBean, or a com.ibm.commerce.catalog.beans.PackageDataBean. If you do not include this parameter, you must include the catentryId parameter (see below).

Using the databean parameter provides better performance than the catentryId parameter because the product tag does not have to use additional resources to generate the data bean from the catentryId.

catentryId
Use this parameter if your product display page does not contain a product-related data bean. This parameter is the catalog entry ID of the catalog entry being displayed. The product tag automatically creates a product-related data bean to get the information that the external analytics system requires.

This parameter is ignored if you have used the databean parameter.

To pass more information to the external analytics system, use the following parameter:

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 : Use the extraparms parameter to pass either Explore attributes, or data for custom reports, or both. See Passing extra data to IBM Digital Analytics with the extraparms parameter.

There are multiple ways to pass values 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 dynamic content by calling a method. Any extraparms value that starts and ends with the $ symbol, for example, $getMethod$, is assumed to be a method name of ProductDataBean, ItemDataBean, BundleDataBean, or PackageDataBean, depending on the type that is being used. The only restriction on the method name is that it must take no arguments and the object that returned must implement the toString() method. extraparms="$getMethod$"

Tag versions

WebSphere Commerce provides two versions of the product tag:

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