This article describes the process for setting up IntelliSuggest page tracking.
The instructions that follow are meant to be a generic guideline, suitable to be translated into any ecommerce platform.
Be sure to replace the placeholder examples with the appropriate values (e.g., "YOUR_SITE_ID" and "SS_UID_CORE_FIELD")
Your Athos Commerce Account Site ID may be found under "My Account" in the top right of the Athos Management Console.
User ID and Shopper ID
IntelliSuggest automatically tracks the user ID as the cookie-generated ssUserId when the shopper is not logged in. API customers need to set tracking cookies for userId while all other integrations have that functionality baked into IntelliSuggest.
Shopper ID must be passed through a setShopperId command. In the event that the shopper is not logged in, an empty shopper ID is passed.
Product Views (Product Detail Page)
Placing the script just before the closing </body> tag works best for user experience/performance.
The SKU argument to the viewItem() should be the unique product SKU that is used in the SKU core field. This may be referenced in your product catalog as a part number or product code for that item.
The UID and SKU passed here should be the same fields as the UID and SKU from your Core Fields setup. If you change the fields in Core Fields or in this tracking, be sure to also change both to match. Failure to do so can result in Product Recommendations and Product Analytics features breaking for your site.
Tracking Child SKUs / Variants
The childUid and/or childSku can be passed in addition to UID and SKU for better tracking and performance of other Athos features. If you pass only childSku and/or childUid (and leave out the parent sku and uid), the event will be included for Personalized Recommendations but completely ignored for Athos reports and other features.
<script type="text/javascript" src="//cdn.searchspring.net/intellisuggest/is.min.js"></script>
<script type="text/javascript">
try{
var product_code = 'SS_UID_CORE_FIELD';
IntelliSuggest.init({ siteId: 'YOUR_SITE_ID', context: 'Product/' + product_code, seed: [product_code] });
IntelliSuggest.setShopperId('THE_SHOPPER_ID');
IntelliSuggest.viewItem({ uid: product_code, sku: 'SS_SKU_CORE_FIELD' });
} catch(err) {}
</script>Basket Contents (Basket or Cart Page)
Placing the script just before the closing </body> tag works best for user experience/performance.
One or more haveItem() calls are allowed. Include a haveItem() call for each item the shopper currently has in their basket. Don't worry about figuring out what they have most recently added or removed — always include all of the items currently in the basket.
The UIDs and SKUs tracked on your Basket Contents page should match the UID and SKU core field tracked on the Product View page.
Tracking Child SKUs / Variants
The childUid and/or childSku can be passed in addition to UID and SKU for better tracking and performance of other Athos features. If you pass only childSku and/or childUid (and leave out the parent sku and uid), the event will be included for Personalized Recommendations but completely ignored for Athos reports and other features.
<script type="text/javascript" src="//cdn.searchspring.net/intellisuggest/is.min.js"></script>
<script type="text/javascript">
try{
IntelliSuggest.init({siteId: 'YOUR_SITE_ID', context: 'Basket', seed: ['ABC123', '1000C', '8ZYX300']});
IntelliSuggest.setShopperId('THE_SHOPPER_ID');
// Loop through products in cart
IntelliSuggest.haveItem({ uid: 'PIDABC123', sku: 'ABC123', qty: '1', price: '107.95' });
IntelliSuggest.haveItem({ uid: 'PID1000C', sku: '1000C', childSku: '400-XYZ', qty: '1', price: '20.00' });
IntelliSuggest.haveItem({ uid: 'PID8ZYX300', sku: '8ZYX300', qty: '1', price: '7.63' });
IntelliSuggest.setCurrency({ code: 'USD' });
// Code should indicate country currency code
IntelliSuggest.inBasket({});
} catch(err) {}
</script>Sale (Order Confirmation Page)
Placing the script just before the closing </body> tag works best for user experience/performance.
The inSale() information arguments are all optional.
The UIDs and SKUs tracked on your Order Contents page should match the UID and SKU core field tracked on the Product View page.
Tracking Child SKUs / Variants
The childUid and/or childSku can be passed in addition to UID and SKU for better tracking and performance of other Athos features. If you pass only childSku and/or childUid (and leave out the parent sku and uid), the event will be included for Personalized Recommendations but completely ignored for Athos reports and other features.
<script type="text/javascript" src="//cdn.searchspring.net/intellisuggest/is.min.js"></script>
<script type="text/javascript">
try{
IntelliSuggest.init({siteId: 'YOUR_SITE_ID' });
IntelliSuggest.setShopperId('THE_SHOPPER_ID');
IntelliSuggest.haveItem({ uid: 'UID10-GRB7', sku: '10-GRB7', qty: '3', price: '5.00' });
IntelliSuggest.haveItem({ uid: 'UID400XYZ', sku: '400XYZ', childUid: 'UID400XYZ-SM', childSku: '400XYZ-SM', qty: '1', price: '10.00' });
IntelliSuggest.setCurrency({ code: 'USD' });
/* Code should indicate country currency code */
IntelliSuggest.inSale({
orderId: '1234', // The Order ID
total: '30.00', // The total order amount (including shipping and taxes)
city: 'Los Angeles', // Customer"s shipping address City (optional)
state: 'CA', // Customer"s shipping address State (optional)
country: 'US' // Customer"s shipping address 2-letter Country Code (optional)
});
} catch (e) {}
</script>Product Clicks (Category, Brand and Search Results Pages)
If you are integrating via our API, you will also need to track product clicks on the search results page and autocomplete. This is not required if you are integrating via our JavaScript Catalog.
Note: These product click tracking events are only relevant to those completing their own custom integration via Athos' RESTful API — Athos' AJAX-based integration will include product click tracking within our item templates.
If you are using the Athos API with the native response format, you will need to handle search and navigation result page click tracking in your result templates. The simplest way to do this is by leveraging the IntelliSuggest.clickItem() method within the Intellisuggest tracking script. This requires having the script loaded where it is being used.
<script type="text/javascript" src="//cdn.searchspring.net/intellisuggest/is.min.js"></script>
To add tracking to product clicks, add the following function call to onMouseDown events on your product links, add to cart buttons, etc., for each product being rendered. Alternatively, you could place the event on the main product element.
onmousedown="IntelliSuggest.clickItem(this, { siteId: 'YOUR_SITE_ID', intellisuggestData: 'THE_PRODUCT_INTELLISUGGESTDATA', intellisuggestSignature: 'THE_PRODUCT_INTELLISUGGESTSIGNATURE' })"Be sure to set the proper Athos Site ID (replace 'YOUR_SITE_ID'). The intellisuggestData and intellisuggestSignature values passed into the "clickItem" method correspond to attributes found within the Athos API response (for each product).
Manually via track.json
Sending events manually via our track.json endpoint has been deprecated, and the instructions for this method have been removed. Please use the above instructions for tracking product clicks using the Intellisuggest tracking script instead.
Comments
0 comments
Article is closed for comments.