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, formerly known as Coremetrics 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 listed at the beginning of this topic 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 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 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. This simplified syntax is supported in WebSphere Commerce Version 7 Feature Pack 3 and later implementations of IBM Digital Analytics. 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$"
Feature Pack 3returnAsJSON
Feature Pack 3An 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 product tag:
[{product:[{productId:"PARTNUMBER",name:"PRODUCTNAME",
category:"CATEGORY",storeId:"STOREID",
masterCategory:"MASTERCATALOGCATEGORY"}]}]

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.