Comparison of extra parameters for IBM Digital Analytics tags

The WebSphere Commerce order tag (<cm:order />) and shopping cart tag (<cm:cart />) support multiple parameters we use to pass additional data to IBM Digital Analytics. Those parameters are extraparms, extraparmsMap, and orderExtraparms (orderExtraparms is applicable only to the order tag). It is important to understand which parameter to choose so that we get the results that you expect in the generated IBM Digital Analytics data tags. The following table summarizes when to use each parameter:

Parameter When to use
extraparms Use when we want to append the same values to all catalog entries in the order.

  • For the <cm:order /> tag, use this parameter to pass values to the IBM Digital Analytics cmCreateShopAction9Tag.

  • For the <cm:cart /> tag, use this parameter to pass values to the IBM Digital Analytics cmCreateShopAction5Tag.

extraparmsMap Use when we want to append different values to specific catalog entries in the order, as defined in a hash map. This parameter is an alternative to the extraparms parameter when you need the additional function of the hash map.

  • For the <cm:order /> tag, use this parameter to pass values to the IBM Digital Analytics cmCreateShopAction9Tag.

  • For the <cm:cart /> tag, use this parameter to pass values to the IBM Digital Analytics cmCreateShopAction5Tag.

orderExtraparms Use when we want to append values to the order.

This parameter is supported by the <cm:order /> tag only; use this parameter to pass values to the IBM Digital Analytics cmCreateOrderTag.

Note: The examples in this topic use the simplified syntax for specifying extraparms values. We must specify the values using properly escaped JavaScript:

If any of your extraparms values are JavaScript variables, see the syntax rules explained in Syntax for passing JavaScript variables as extra parameters.


Example of extraparms parameter usage

The following shows an example of how you would include a WebSphere Commerce analytics tag with the extraparms parameter in a store page:

In this example, the previous sample code generates the following cmCreateShopAction9Tag data tags for two catalog entries in the order (note that the <order /> tag also generates the cmCreateOrderTag data tag, but it is not shown in this example):

In the previous cmCreateShopAction9Tag output examples, the extraparms parameter generated the following data for both catalog entries in the order:

To understand the format for extraparms values, see:


Example extraparmsMap parameter usage

To append different values to specific catalog entries, we must pass an object of type java.util.HashMap as the value for extraparmsMap. The key of the map is the orderItemId and the value is the extra parameter to pass for that catalog entry.

The following sample code shows how we might use the extraparmsMap parameter with a WebSphere Commerce analytics tag in a store page; note that the code to create the java.util.HashMap object precedes the WebSphere Commerce analytics tag:

The previous sample code generates the following example cmCreateShopAction9Tag output for two catalog entries in the order: "Flavour-Fantasy Gift Set" and the "Rolling Pin":

In the previous cmCreateShopAction9Tag output examples, the extraparmsMap parameter generated the following data:

To understand the format for extraparms values, see:


Example of orderExtraparms parameter usage

The following shows an example of how we might include a WebSphere Commerce analytics tag with the orderExtraparms parameter in a store page:

The previous sample code generates the following cmCreateOrderTag data tag (note that the <order /> tag also generates the cmCreateShopAction9Tag data tag, but it is not shown in this example):

In the previous cmCreateOrderTag output example, the orderExtraparms parameter generated the following data about the order:


Related concepts
Passing extra data to IBM Digital Analytics with the extraparms parameter


Related reference
Use the order tag with IBM Digital Analytics
Use the shopping cart tag with IBM Digital Analytics