Using the order tag with IBM Digital Analytics
If your site is integrated with IBM Digital Analytics, formerly known
as Coremetrics Analytics,
you can use the default implementation of the <cm:order
/>
tag that WebSphere Commerce provides. The <cm:order
/>
tag generates two IBM Digital Analytics data
tags: cmCreateShopAction9Tag
and cmCreateOrderTag
.
Tag placement in the store JSP page
Include
the <cm:order />
tag in the order confirmation
page. In the page, place the <cm:order />
tag
before the <cm:pageview />
tag.
You must also include the tag library in the store JSP page before the main page content. Use the following code:
<%@ taglib uri="http://commerce.ibm.com/coremetrics" prefix="cm" %>
The data output by the <cm:order />
tag
differs depending on which IBM Digital Analytics tag
library type your store uses. To see examples, go to one of the following
sections:
Example of tag usage and output for IBM Digital Data Exchange (DDX)
If your WebSphere Commerce store is integrated with DDX to simplify collecting analytics data, the<cm:order />
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.transaction={attributes:{exploreAttributes:'',
extraFields:'-_--_--_--_--_--_--_--_--_--_--_--_-Save $25 on all orders over $200 USD-_--25.00-_-'},
profile:{address:{city:'City', postalcode:'90210', state_province:'CA'},
profileInfo:{profileID:'-1000'}},
total:{basePrice:'1110.00', currency:'USD', shipping:'0.00'}, transactionID:'11001'};
digitalData.transaction.item=new Array();
digitalData.transaction.item[0]={};
digitalData.transaction.item[0]={attributes:{exploreAttributes:'',
extraFields:'-_--_--_--_--_--_--_--_--_--_--_--_--_-'},
category:{primaryCategory:'3074457345616676683', virtualCategory:''},
currency:'USD', price:'977.97',
productInfo:{productID:'MCL008_0802',
productName:'Albini Dark Gray Wool Suit'}, quantity:'1'};
digitalData.transaction.item[1]={};
digitalData.transaction.item[1]={attributes:{exploreAttributes:'',
extraFields:'-_--_--_--_--_--_--_--_--_--_--_--_--_-'},
category:{primaryCategory:'3074457345616676695', virtualCategory:''},
currency:'USD', price:'132.03', productInfo:{productID:'CAC024_2401',
productName:'Widescreen LCD Monitor'}, quantity:'1'};
cmSetupOther({"cm_currencyCode":"USD"});
For more information about integrating with DDX, see IBM Digital Data Exchange integration.
Examples of tag usage: for the standard IBM Digital Analytics library
The<cm:order
/>
tag generates two IBM Digital Analytics data
tags:- For each item in the shopping cart, the following tag is generated:
cmCreateShopAction9Tag (productID, productName, productQuantity, productPrice, customerID, orderID, orderTotal, categoryID, attributes, extraFields)
Note: For B2B direct store transactions, the<cm:order />
tag passes account and contract names by using theextraFields
parameter. ThecmCreateShopAction9Tag
requires these names to be passed as the 13th and 14thextraFields
values, and each value must be separated with the-_-
delimiter. Therefore, the value of theextraFields
parameter would look like the following code in the generatedcmCreateShopAction9Tag
:-_--_--_--_--_--_--_--_--_--_--_--_-AccountName-_-ContractName
- For order summary information, the following tag is generated:
cmCreateOrderTag (orderID, orderTotal, orderShipping, customerID, customerCity, customerState, customerZIP, attributes, extraFields)
Note: The<cm:order />
tag passes data about promotions that are applied to the order by using theextraFields
parameter. ThecmCreateOrderTag
requires the promotion details to be passed as the 13th, 14th, and 15thextraFields
values, and each value must be separated with the-_-
delimiter. Therefore, the value of theextraFields
parameter would look l like the following code in the generatedcmCreateOrderTag
:-_--_--_--_--_--_--_--_--_--_--_--_-PromoName-_-PromoDiscount-_-PromoCode
Example 1:
To pass the basic order summary and shopping cart item data to IBM Digital Analytics:
Include tag in your store page with the following code: | If your store uses data beans and URL commands
for order runtime functions, use the databean parameter:
If your store uses web services for order runtime functions,
use the
|
Example of IBM Digital Analytics data tags generated: | For shopping cart item data:
For order summary information:
Note: In the previous example,
the order that is qualified for a promotion, so promotion-related
information is passed in the last parameter, extraFields . |
Example 2:
To include
the tax in the unit price and order total that is sent to IBM Digital Analytics,
use the includeTaxInUnitPrice
and includeTaxInTotalPrice
parameters:
Include tag in your store page with the following code: | If your store uses data beans and URL commands
for order runtime functions:
If your store uses web services for order runtime functions:
|
Example of IBM Digital Analyticsdata tags generated: | For shopping cart item data: (same as Example 1, except that the productPrice parameter value includes tax) For order summary information: (same as Example 1, except that the orderTotal parameter value and shipping charges include tax) |
Example 3:
To pass IBM Digital Analytics Explore
attributes to the IBM Digital Analytics cmCreateShopAction9Tag
and cmCreateOrderTag
,
use the extraparms
parameter (second position) and orderExtraparms
parameter
(first position):
Include tag in your store page with the following code: | If your store uses data beans and URL commands
for order runtime functions:
If your store uses web services for order runtime functions:
|
Example of IBM Digital Analyticsdata tags generated: | For shopping cart item data:
For order summary information:
Note: In the previous example,
the order that is qualified for a promotion, so promotion-related
information is passed in the last parameter, extraFields . |
Example 4:
To pass both IBM Digital Analytics Explore
attributes and more data for custom reports to the IBM Digital Analytics cmCreateShopAction9Tag
and cmCreateOrderTag
,
use the extraparms
parameter (second and third position)
and the orderExtraparms
parameter (first and second
position):
Include tag in your store page with the following code: | If your store uses data beans and URL commands
for order runtime functions:
If your store uses web services for order runtime functions:
|
Example of IBM Digital Analyticsdata tags generated: | For shopping cart item data:
For order summary information:
Note: In the previous example,
the order that is qualified for a promotion, so promotion-related
information is passed in the last parameter, extraFields . |
For details about each parameter in the IBM Digital Analytics data tag, see the documentation that is provided by IBM Digital Analytics.
Examples of tag usage: for the custom IBM Digital Analytics library
The<cm:order
/>
tag generates two IBM Digital Analytics data
tags:- For each item in the shopping cart, the following IBM Digital Analytics tag
is generated:
cmCreateShopAction9Tag (productId, productName, productQuantity, productPrice, customerId, orderId, orderTotal, categoryId, store_id, currency, account_name, contract_name, masterItemCategory, catIDoverride, attributes)
- For order summary information, the following IBM Digital Analytics tag
is generated:
cmCreateOrderTag (orderId, orderTotal, orderShipping, customerId, customerCity, customerState, customerZip, store_id, currency, promotion_name, promotion_discount, promotion_code, attributes)
Example 1:
To pass the basic order summary and shopping cart item data to IBM Digital Analytics:
Include tag in your store page with the following code: | If your store uses data beans and URL commands
for order runtime functions, use the databean parameter:
If your store uses web services for order runtime functions,
use the
|
Example of IBM Digital Analyticsdata tags generated: | For shopping cart item data:
For order summary information:
|
Example 2:
To include
the tax in the unit price and order total that is sent to IBM Digital Analytics,
use the includeTaxInUnitPrice
and includeTaxInTotalPrice
parameters:
Include tag in your store page with the following code: | If your store uses data beans and URL commands
for order runtime functions:
If your store uses web services for order runtime functions:
|
Example of IBM Digital Analyticsdata tags generated: | For shopping cart item data: (same as Example 1, except that the productPrice parameter value includes tax) For order summary information: (same as Example 1, except that the orderTotal parameter value and shipping charges includes tax) |
extraparms
and orderExtraparms
values.
If your store is not on WebSphere Commerce Version 7 Feature Pack
3 or later, you must specify the values using properly escaped JavaScript: - Simplified syntax example
extraparms="value1,value2"
- Properly escaped JavaScript example
extraparms="\"value1\",\"value2\""
Example 3:
To pass IBM Digital Analytics Explore
attributes to the IBM Digital Analytics cmCreateShopAction9Tag
and cmCreateOrderTag
,
use the extraparms
parameter (second position) and
the orderExtraparms
parameter (first position):
Include tag in your store page with the following code: | If your store uses data beans and URL commands
for order runtime functions:
If your store uses web services for order runtime functions:
|
Example of IBM Digital Analyticsdata tags generated: | For shopping cart item data:
For order summary information:
|
Example 4:
To pass both IBM Digital Analytics Explore
attributes and more data for custom reports to
the IBM Digital Analytics cmCreateShopAction9Tag
and cmCreateOrderTag
,
use the extraparms
parameter (second and third position)
and the orderExtraparms
parameter (first and second
position):
Include tag in your store page with the following code: | If your store uses data beans and URL commands
for order runtime functions:
If your store uses web services for order runtime functions:
|
Example of IBM Digital Analytics data tags generated: | For shopping cart item data:
For order summary information:
|
For details about each parameter in the IBM Digital Analytics data tag, see the documentation that is provided by IBM Digital Analytics.