Using the registration 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: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. To see examples, go to one of the following sections in the following topic:

Feature Pack 8

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.

Feature Pack 3

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

The <cm:registration /> tag generates the following IBM Digital Analytics data tag:
cmCreateRegistrationTag(customerID, customerEmail, customerCity, 
customerState, customerZIP, customerCountry, attributes)
Note: The <cm:registration /> tag passes certain registration data as an attribute string by using the attributes parameter. The cmCreateRegistrationTag requires that each parameter is separated with the -_- delimiter. Therefore, the value of the attributes parameter would look like this in the generated cmCreateRegistrationTag:
age-_-gender-_-marital_status-_-num_children-_-num_in_household-_-company_name-_-hobbies-_-income

For the IBM Digital Analytics hosted tag library file, the subscribedFlag parameter and the newsletterFlag parameter are no longer passed.

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 data beans 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", "US",
 "-_-N-_--_--_--_--_--_-");

Example 2:

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

Include tag in your store page with the following code:
<cm:registration personType="${personType}" 
extraparms="attr1-_-attr2-_-attr3"/>
Example of IBM Digital Analyticsdata tag generated:
cmCreateRegistrationTag("2002", "user1@test.com", "LA", "CA", "45123", "US", 
"-_-N-_--_--_--_--_--_-
-_-attr1-_-attr2-_-attr3");

Notice that the three values (attr1-_-attr2-_-attr3) passed by the extraparms parameter are in the 9th, 10th, and 11th position for the attributes parameter in the generated cmCreateRegistrationTag data tag. Positions 1 - 8 are reserved for the attribute string that contains registration data (age-_-gender-_-marital_status-_-num_children-_-num_in_household-_-company_name-_-hobbies-_-income). In other words, any values you pass explicitly by using the extraparms parameter are placed in positions 9 - 15 for the attributes parameter in the generated data tag.

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: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. 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,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 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.