Introduced in Feature Pack 3

Examples: passing data about search facet usage as IBM Digital Analytics Explore attributes

The WebSphere Commerce analytics tags can collect data about how customers are using search facets to navigate your site. By using the extraparms parameter in a WebSphere Commerce analytics tag, you can collect this data for use in reports from IBM Digital Analytics, formerly known as Coremetrics Analytics. You can use this data as IBM Digital Analytics Explore attributes that you can use in Explore reports for analysis.

Customers use search facets to narrow results by brand, category, price, and so on. Search facets are supported for stores that use WebSphere Commerce search with a Solr index.

The following examples show how the Madisons and Elite starter store pages are tagged to collect facet usage data as IBM Digital Analytics Explore attributes. Each selected facet value such as 'Brand:AromaStar' is sent as dedicated Explore attribute. If you have your own custom store, you can use these examples as a starting point before you tag your own store to collect this data.

Overview

Facet usage data is collected in the following starter store pages by using the tags that are listed on the right:

Store page WebSphere Commerce analytics tag that is used to collect facet usage data
Search results page <cm:pageview />
Product display page, Product quick info page <cm:product />
Order confirmation page <cm:order />
Shopping cart page <cm:cart />

As a customer searches or browses for products, each facet that the customer clicks is stored in the following session cookie:

analyticsFacetAttributes

The purpose of the cookie is to provide the WebSphere Commerce analytics tags with up-to-date facet usage data. As the customer moves through the shopping flow, from the search results page to the product display page, shopping cart page, and order confirmation page, the cookie tracks and carries forward the list of facets that the customer clicked, making this data available to the analytics tags in those pages. The cookie is continually updated until the customer starts a new search or starts a new session.

Tagging examples: prerequisite reading

In the starter stores, the WebSphere Commerce data tags pass facet usage data to IBM Digital Analytics as Explore attributes by using the extraparms parameter. Before you review the following examples, you must understand the correct position to place values in the extraparms parameter. The values are passed as Explore attributes and not some other value. Read Passing extra data to IBM Digital Analytics with the extraparms parameter, and note that the position of Explore attribute values varies for different WebSphere Commerce analytics tags.
In each of the examples (except Example 1), the following extraparms value is used to collect facet usage data:
${cookie.analyticsFacetAttributes.value}
This cookie object gets data from the analyticsFacetAttributes session cookie.

Example 1: <cm:pageview /> tag

To collect facet usage data from the search results page, the <cm:pageview /> tag uses the extraparms parameter as shown here:
<cm:pageview pagename="${WCParam.pagename}" category="${WCParam.category}" 
srchKeyword="${WCParam.searchTerms}" srchResults="${WCParam.searchCount}" 
returnAsJSON="true" extraparms="${WCParam.attributes}" />

The <cm:pageview /> collects the facets from the page URL by using the ${WCParam.attributes} value, rather than from the session cookie. Notice that the ${WCParam.attributes} value is in the first position for extraparms values.

Example 2: <cm:product /> tag

To collect facet usage data from the product display and product quick info pages, the <cm:product /> tag uses the extraparms parameter as shown here:
<cm:product databean="${product}" extraparms="null, ${cookie.analyticsFacetAttributes.value}"/>

Notice that the ${cookie.analyticsFacetAttributes.value} value is in the second position for extraparms values.

Example 3: <cm:cart /> tag

To collect facet usage data from the shopping cart page, the <cm:cart /> tag uses the extraparms parameter as shown here:
<cm:cart orderType="${orderForAn}" extraparms="null, ${cookie.analyticsFacetAttributes.value}"/>

Notice that the ${cookie.analyticsFacetAttributes.value} value is in the second position for extraparms values.

Example 4: <cm:order /> tag

To collect facet usage data from the order confirmation page, the <cm:order /> tag uses the extraparms parameter as shown here:
<cm:order orderId="${WCParam.orderId}" extraparms="null, ${cookie.analyticsFacetAttributes.value}"/>

Notice that the ${cookie.analyticsFacetAttributes.value} value is in the second position for extraparms values.