In addition to inserting the call to the JavaScript library in the <head> element, the ADC pipeline inserts clickstream tracking code in the <body> element of the page. This is HTML that is not actually displayed, but which is used to supply Oracle Recommendations with information about the contents of the page for tracking purposes. After the page loads, the atgsvcs.js script executes and sends the information in the clickstream code to Oracle Recommendations.

For example, on a product detail page, the tracking code provides information about the product being viewed:

<div id="cs-cfg" style="display:none !important;">
  <dl class="cs-cfg">

Clickstream tracking code on other pages may include different information. For example, the tracking code for the shopping cart page includes information about the items in the cart, and the tracking code for a browse page (search results) includes information about the search term the customer entered. This information is used by Oracle Recommendations to determine, for example, the likelihood of a certain item being purchased if it was found by entering a specific search term.

Endeca-Driven Pages

To insert clickstream tracking code on an Endeca-driven page, the page code must determine whether the page is a category page or a browse page. To do this, the catalogItemBrowsed.jsp gadget, which is included in pages by the <crs:pageContainer> tag, invokes the StoreCartridgeTools.userOnCategoryPage() method:

<dsp:getvalueof var="isUserOnCategoryPage"

The method checks whether the current navigation state includes the CategoryOnly user segment. If so, the method returns true, and the gadget triggers a CategoryBrowsed event that identifies the category being viewed:

<c:if test="${isUserOnCategoryPage }">

  <dsp:droplet name="CategoryLookup">
    <dsp:param name="id" bean="CatalogNavigation.currentCategory"/>
    <dsp:oparam name="output">
      <%-- Send 'Category Browsed' event --%>
      <dsp:droplet name="/atg/commerce/catalog/CategoryBrowsed">
        <dsp:param name="eventobject" param="element"/>

The ADC pipeline uses the information about the category when it constructs the clickstream tracking code for the page.

If the userOnCategoryPage() method returns false, but the page URL matches the configured value for the search results page, the page is a browse page. The ADC pipeline is supplied with information about the search term used in the query, which it includes in the clickstream code. This behavior is configured through the StoreRecommendationsConfiguration component:


Ntt is the query parameter used to pass the search term to Endeca, and /cartridges/PageSlot/PageSlot.jsp is the URL of the renderer for the top-level content item returned for a /browse request. See the Using Cartridges chapter for more information.

Copyright © 1997, 2013 Oracle and/or its affiliates. All rights reserved. Legal Notices