Using the registration tag with IBM Digital Analytics

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

Tag placement in store pages

Include the <cm:registration /> tag in your customer account display JSP page. In the page, place the <cm:registration /> tag before the <cm:pageview /> tag.

To use the <cm:registration /> tag, you must also include the tag library in the JSP file before the main page content. Use the following code to include the tag library:


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

The data that the <cm:registration /> tag generates is different depending on which version of the IBM Digital Analytics library your store uses.

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:registration /> 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.user=new Array();
digitalData.user[0]={};
digitalData.user[0].profile=new Array();
digitalData.user[0].profile[0]={};
digitalData.user[0].profile[0]={address:{city:'City', country:'US', postalcode:'90210', state_province:'CA'}, 
  profileInfo:{exploreAttributes:'-_--_--_--_--_--_--_-', 
  profileEmail:'johnsmith@example.com', profileID:'-1000'}};
In this output, the format user[0].profile[0] is used to include the user data. This format is the only format that WebSphere Commerce and IBM Digital Analytics supports.

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

Examples of tag usage: for the custom IBM Digital Analytics library

The <cm:registration /> tag generates the following IBM Digital Analytics data tag:
cmCreateRegistrationTag(customerId, customerEmail, customerCity, 
customerState, customerZip, __nl, __sd, store_id, 
customer_country, age, gender, marital_status, 
num_children, num_in_household, company_name, hobbies, 
income, attributes)

Example 1:

To pass basic registration data to IBM Digital Analytics:

Include tag in your store page with the following code: If your store uses databeans and URL commands for registration runtime functions, you can include the tag with no parameters:
<cm:registration />

If your store uses web services for registration runtime functions, use the personType parameter:

<cm:registration personType="${personType}"/>
Example of IBM Digital Analytics data tag generated:
cmCreateRegistrationTag("2002", "user1@test.com", "LA", "CA", "45123", 
null, null, "10101", "US", null, "N", null, null, null, null, null, null);

Example 2:

To pass Explore attributes to IBM Digital Analytics, use the extraparms parameter (first position):

Note: The examples in this topic use the simplified syntax for specifying extraparms values. You must specify the values using properly escaped JavaScript:
Simplified syntax example
extraparms="value1-_-value2,value3-_-value4"
Properly escaped JavaScript example
extraparms="\"value1-_-value2\",\"value3-_-value4\""

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

Include tag in your store page with the following code:
<cm:registration personType="${personType}" 
extraparms="attr1-_-attr2-_-attr3"/>
Example of IBM Digital Analytics, formerly known as Coremetrics Analytics data tag generated:
cmCreateRegistrationTag("2002", "user1@test.com", "LA", "CA", "45123", 
null, null, "10101", "US", null, "N", null, null, null, null, null, null, 
"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.