How to track performance
Tracking Setup with Recos Tag
Prerequisite :
recos
1
Enriching Your HTML for Tracking
Enrich your recommendation banner HTML
Attribute
Purpose
Example
Required
Automatic Event Detection
Practical example
<div
data-reco-debug="true"
data-reco-id="082ecd63-84ec-4f48-90ce-12271d456020"
>
<div data-item-id="X23" data-reco-click="go_to_page">
<button data-reco-click="add_to_cart_item"></button>
</div>
<div data-item-id="Y47" data-reco-click="go_to_page">
<button data-reco-click="add_to_cart_item"></button>
</div>
</div>window.dataLayer.push([
"event",
"ab_recos_[uuidXX]",
{
action_id: "show",
reco_id: "082ecd63-84ec-4f48-90ce-12271d456020",
item_ids: "[\"X23\",\"Y47\"]",
debug_mode: true
}
]);window.dataLayer.push([
"event",
"ab_recos_[uuidYY]",
{
action_id: "go_to_page",
reco_id: "082ecd63-84ec-4f48-90ce-12271d456020",
item_id: "X23",
item_ids: "[\"X23\",\"Y47\"]",
debug_mode: true
}
]);window.dataLayer.push([
"event",
"ab_recos_[uuidZZ]",
{
action_id: "add_to_cart_item",
reco_id: "082ecd63-84ec-4f48-90ce-12271d456020",
item_id: "X23",
item_ids: "[\"X23\",\"Y47\"]",
debug_mode: true
}
]);2
3
Retrieving Products from a RECO_ID
Example
recos.reco(RECO_ID).then(console.log);[
{
"id": "id1",
"title": "title 1",
"price": 20,
"strike_price": 40,
"discount_rate": 50,
"img_link": "https://image.png",
"link": "https://link1"
},
{
"id": "id2",
"title": "title 2",
"price": 30,
"strike_price": null,
"discount_rate": 0,
"img_link": "https://image.png",
"link": "https://link2"
}
]recos.variable(VARIABLE_NAME).then(console.log);How to follow performance ?
Metric
Description
Last updated
Was this helpful?

