Page view tag
The WebSphere Commerce page view tag collects information about store pages that a customer viewed.
This tag collects the following data to pass to an external analytics system:
- Page name
- Page category
- Search keyword, when the page viewed is a search results page
- Search results count, when the page viewed is a search results page
- Store identifier
This tag can also pass extra parameters for tag customization.
Parameters
The following list identifies the required and optional parameters for the page view tag.
Note for IBM Digital Analytics: The following parameters are
for the WebSphere Commerce
<cm:pageview />
tag. This tag generates the IBM Digital Analytics
cmCreatePageViewTag
data tag.
- pageType
- An optional parameter that identifies the page type. Use this parameter when your WebSphere Commerce store is integrated with IBM Digital Data Exchange (DDX). The value for this
parameter is used as a unique page type identifier to identify the data that is retrieved for a page
and sent to DDX. DDX uses this
parameter value to determine how to relay the data, for instance, to IBM Digital Analytics
for analysis.
The default value for this parameter is
"wcs-standardpages"
, which identifies a page as a standard WebSphere Commerce store page. To include other parameter values on store pages, configure DDX to create the page group and rule for the value and define how DDX is to relay the data that is associated with the value. For more information about setting values for this parameter, see Configuring the IBM Digital Data Exchange integration. - pagename
- An optional parameter that communicates a specific page name to the external analytics system. If you do not include this parameter, the page view tag uses the page title.
- category
- An optional parameter that communicates the category ID of the page.
On search results pages, you must include more parameters to communicate search-related data to an external analytics system:
- If your site uses the com.ibm.commerce.search.beans.CatEntrySearchListDataBean, use the following parameter:
- databean
- The object that is passed must be a populated instance of the CatEntrySearchListDataBean. The page view tag uses this data bean to find the search keyword and the number of results that are returned to pass to the external analytics system. If you use this parameter, do not use the srchKeyword or srchResults parameters.
- If your store does not use the CatEntrySearchListDataBean, or you do not get an instance of the
CatEntrySearchListDataBean in your search results page, use both of the following parameters:
- srchKeyword
- This parameter communicates the search keyword that is used when the page viewed is a search results page. If you use this parameter, do not use the databean parameter.
- srchResults
- This parameter communicates the number of search results when the page viewed is a search results page. If you use this parameter, do not use the databean parameter.
To send more information to the external analytics system, use the following parameter:
- extraparms
- An optional parameter that communicates more information to the external analytics system. This
parameter is provided for cases in which you might need to generate some custom report that requires
more information. There are multiple ways to pass values by using the
extraparms
parameter:Description Example Specify explicit values as properly escaped JavaScript. To pass more than one value, separate values with a comma. extraparms="\"value1\",\"value2\""
Specify dynamic content by calling a method. Any extraparms
value that starts and ends with the $ symbol, for example,$getMethod$
, is assumed to be a method name of theCatEntrySearchListDataBean
. The only restriction on the method name is that it must take no arguments and the object that returned must implement the toString() method.extraparms="$getMethod$"
Note for : Use the
extraparms
parameter to pass either Explore attributes, or data for custom reports, or both. See Passing extra data to IBM Digital Analytics with the extraparms parameter. - returnAsJSON
- An optional parameter that is designed for use when you are tracking customer interactions that
do not cause a full page refresh. For example, in a web 2.0 store, the customer might interact with
the mini shopping cart, the Product Fast Finder, or a wish list. To track these intrapage
interactions, you can use this parameter to return a JSON object instead of generating the analytics
data tag. When the web 2.0 store tagging framework detects that this analytics event occurs, the
tagging framework can use the JSON object to populate the analytics data tag. You can set the
following values for this parameter:
- true
- Return a JSON object.
- false
- Generate the analytics data tag.
[{pagename:"PAGENAME",category:"PAGECATEGORY", searchTerms:"SEARCHTERM",searchCount:"SEARCHCOUNT", storeId:"STOREID"}]
Tag versions
WebSphere Commerce provides two versions of the page view tag:
- An abstract base tag implementation class: com.ibm.commerce.bi.taglib.CommonBaseTag. Analytics vendors who want to provide a page view tag in their web analytics JSP tag library for WebSphere Commerce can extend this base tag class. Vendors can extend the tag class to get the page view data and implement their own logic to generate the vendor-specific page view tagging APIs.
- A default implementation of the page view tag (
<cm:pageview />
) for IBM Digital Analytics. This implementation automatically generates the IBM Digital AnalyticscmCreatePageViewTag
data tag.