Overview
Instructions to send "Add to Cart" browse click information using the Javascript Tagging Library.
Step-by-step guide
This event must be triggered when any product is added to cart from product category page after a browse to the category is performed. At that moment, the function trackBrowseAdd2Cart should be executed.
trackBrowseAdd2Cart(categoryid, page, position, productid, title, url, options, callback)
Parameters
Parameter | Description | Data Type | Mandatory |
---|---|---|---|
categoryid | The ID of the Product Category Page where the product is selected | String | Yes |
page | The page number | Integer | Yes |
position | The position of the product selected on Product Category Page. | Integer | No* |
productId | The product ID of the selected result. | String | No* |
title | The product or result title | String | Yes |
url | Destination URL, for example product detail page | String | Yes |
options | Object that may contain information about filters and other required data | Object | No |
callback | Function that will be executed after sending data | Function | No |
*This parameters are not mandatory for the service but necessary for the statistics |
Options
The options object should contains additional parameters not passed as parameters in function call:
{ lang: LANGUAGUE, scope: SCOPE, section: SECTION, user: USER_ID, session: SESSION_ID }
Parameter | Description | Data Type | Mandatory |
---|---|---|---|
lang | Language identifier (es, en...) | String | No |
scope | Scope identifier (desktop, mobile, android app, iOS app...) | String | No |
section | Section value if it is required for the project | String | No |
user | UserID used for user based services | String* | No |
session | SessionID used for user based services | String | No |
*UserID should be an UUID identifier.
NOTE: The values for scope and lang will be provided by the Empathy Team.
NOTE: If you are setting up the trackBrowseAdd2Cart function into the product detail page, categoryId and page values will be relative to the product situation into the category grid before being clicked by the user.
The callback function receives an object with the following content. Also options parameters are included:
{ page: page, productId: productid, categoryId: categoryid, position: position, title:title, url:url, follow: false }
Code samples
Selectors using jQuery (you could use other frameworks to build the selectors)
empathyTAG.trackBrowseAdd2Cart('MyCatID', 1, 3, "My product id", 'My product title', 'http://MY_PRODUCT_URL.com',{lang:'en',scope:'testscope'},function(){});
Related articles
-
Javascript Tagging Library: Track Conversion Clicks (Empathy Knowledge Base)
-
Javascript Tagging Library: Track Wishlist Clicks (Empathy Knowledge Base)
-
Using Javascript Tagging Library - Deprecated (Empathy Knowledge Base)
-
Javascript Tagging Library: Track Add2Cart Clicks (Empathy Knowledge Base)
-
Javascript Tagging Library: Track Clicks (Empathy Knowledge Base)
-
Javascript Tagging Library: Track Queries (Empathy Knowledge Base)
-
Using Javascript Tagging Library - 1.3 - Deprecated (Empathy Knowledge Base)
-
Javascript Tagging Library: Track Checkout (Empathy Knowledge Base)
-
Javascript Tagging Library - Track Search (Empathy Knowledge Base)
-
Javascript Tagging Library - Track Browse (Empathy Knowledge Base)
-
Javascript Tagging Library: Track Browse Add2Cart (Empathy Knowledge Base)
-
Javascript Tagging Library: Track Browse Category (Empathy Knowledge Base)
-
Javascript Tagging Library: Track Query (Empathy Knowledge Base)
-
Javascript Tagging Library: Track Browse Product (Empathy Knowledge Base)
-
Javascript Tagging Library: Track Wishlist (Empathy Knowledge Base)