Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

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, scope, options, callback)

Parameters

ParameterDescriptionData TypeMandatory
categoryidThe ID of the Product Category Page where the product is selectedStringYes
pageThe page numberIntegerYes
positionThe position of the product selected on Product Category Page.IntegerNo*
productIdThe product ID of the selected result.StringNo*
titleThe product or result titleStringYes
urlDestination URL, for example product detail pageStringYes
scopeThis parameter is used for separate analytic data between two or more different scenariosStringNo*
optionsObject that may contain information about filters and other required dataObjectNo
callbackFunction that will be executed after sending dataFunctionNo
*This parameters are not mandatory for the service but necessary for the statistics


The options object should contains additional parameters not passed as parameters but also necessary such as language. Also section, userID and sessionID that must be included if they're available or required:

{
    lang: LANGUAGUE,
	section: SECTION,
	user: USER_ID,
	session: SESSION_ID
}


The callback function receives an object with the following content:

{
	page: page,
    productId: productid,
    categoryId: categoryid,
    position: position,
    title:title,
    url:url,
    scope: scope,
    follow: false
}

NOTE: The values for scope and options parameters will be provided by the Empathy Team.The callback also receives the parameter lang, user, session and the other params sent in options.

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.

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','testscope',{lang:'en'},function(){});

  • No labels