Using the conversion event tag with IBM Digital Analytics

If your site is integrated with IBM Digital Analytics, you can use the default implementation of the <cm:conversion /> tag that HCL Commerce provides. The <cm:conversion /> tag generates the following IBM Digital Analytics tag: cmCreateConversionEventTag.

Tag placement in store pages

A conversion event might be a customer that is subscribing to a newsletter or adding an item to a wish list. Include the <cm:conversion /> tag in the page that loads when a customer triggers the specific conversion event. For example:
  • You might have a Subscribe button on a store page that customers can click to subscribe to a newsletter. To track this conversion event, place the <cm:conversion /> tag in the page that loads when the customer clicks the button.
  • To track customers that add items to a wish list, place the <cm:conversion /> tag in the page that loads immediately after the user adds an item to the wish list.
This tag is not necessary on JSP fragments or other included file assets.

You must also include the tag library in the JSP file before the main page content by using the following code:


<%@ taglib uri="http://commerce.ibm.com/coremetrics" prefix="cm" %>

Example of tag usage and output for IBM Digital Data Exchange (DDX)

If your HCL Commerce store is integrated with DDX to simplify collecting analytics data, the <cm:conversion /> tag generates data into the digitalData JavaScript object that is sent to DDX. DDX can then relay the data to IBM Digital Analytics. The generated data that in this JavaScript object can look like the following output:
digitalData = { pageInstanceID:'wcs-standardpage_wcs-productdetail', 
  event:[{eventInfo:{eventName: 'AddToWishlist', 
  eventAction: '2', eventPoints: '10'}, category:{primaryCategory: 'WISHLIST'}, 
  attributes:{exploreAttributes: '', extraFields: ''}}]}

For more information about integrating with DDX, see IBM Digital Data Exchange integration.

Examples of tag usage

The <cm:conversion /> tag generates the following IBM Digital Analytics data tag:
cmCreateConversionEventTag(eventID, actionType, eventCategoryId, points, attributes, extraFields)

Example 1:

To pass basic conversion event data to IBM Digital Analytics:

Include tag in your store page with the following code:
<cm:conversion eventId="AddToWishlist" category="WISHLIST" actionType="2" points="10"/>
Example of IBM Digital Analytics data tag generated:
cmCreateConversionEventTag ("AddToWishlist", "2", "WISHLIST", "10")

Example 2:

To pass Explore attributes along with the conversion event tag to IBM Digital Analytics, use the extraparms parameter (first position):

Include tag in your store page with the following code:
<cm:conversion eventId="AddToWishlist" category="WISHLIST" actionType="2" points="10" 
extraparms="attr1-_-attr2-_-attr3"/>.
Example of IBM Digital Analytics data tag generated:
cmCreateConversionEventTag ("AddToWishlist", "2", "WISHLIST", "10", 
"attr1-_-attr2-_-attr3")

For details about each parameter in the IBM Digital Analytics data tag, see the documentation that is provided by IBM Digital Analytics.