https://bonlook.ua/
Мы отслеживаем несколько взаимодействий для ecommerce: impressions, detail, addToCart, checkout, purchase.
Нужно установить следующие коды на сайт.
ВНИМАНИЕ! Вставляйте свои переменные, такие как price, name, id, и тд.
1. Impressions. Вызывать на главной странице, страницах категорий (на страницах категорий измените параметр "list" на название категории).
dataLayer.push({
'event': "impressions",
"ecommerce": {
"currencyCode": "UAH",
"impressions": [{ //array of products on homepage
"id": "9bdd2", //ID product
"name": "Skydive Mission Beach", //product name
"price": "44.00", //price
"brand": "Compton", //brand
"category": "Adventure", //category
"position": 0, //product position in the list (number)
"list": "homepage" //list type (examples: search result, category cats, home)
},
{
"id": "f6be8",
"name": "Skydive Mission Beach",
"price": "33.00",
"brand": "Comverges",
"category": "Adventure",
"position": 1,
"list": "homepage"
},
{
"id": "b55da",
"name": "Cairns City Sunset",
"price": "16.00",
"brand": "Flexigen",
"category": "Adventure",
"position": 2,
"list": "homepage"
}]
}
}
});
2. Detail. Вызывать на страницах продуктов
dataLayer.push({
'event': 'detail',
'ecommerce': {
'detail': {
'actionField': {'list': 'product'}, //list type (example: search result, sales)
'products': [{
'name': 'Shirt', //product name
'id': '5081', //ID product
'price': '403.00', //price
'brand': '', //brand
'category': 'type', //design type
'variant': 'full' //here your variant of book
}]
}
}
});
3. addToCart. Вызывать при нажатии кнопки “В корзину”.
dataLayer.push({
"event": "addToCart",
"ecommerce": {
"currencyCode": "UAH",
"add": {
"products": [{
"id": "bc823", //ID product
"name": "Cairns City Sunset Bike Tour", //product name
"price": "92.00", //price
"brand": "Fuelworks", //brand
"category": "Adventure", //category
"variant": "full", //variant
"quantity": 1 //quantity, example: 2
}]
}
}
});
4. Checkout. Страницы оформления заказа.
dataLayer.push({
"event": "checkout",
"ecommerce": {
"checkout": {
'actionField': {'step': 1}, //number of step
'products': [{
"id": "f6be8", //ID product
"name": "Comverges", //product name
"price": "33.00", //price
"brand": "Comverges", //brand
"category": "Adventure", //category
"variant": "full", //variant
"quantity": 1 //quantity, example: 2
},
{
"id": "b55da",
"name": "Flexigen",
"price": "16.00",
"brand": "Flexigen",
"category": "Adventure",
"variant": "full",
"quantity": 1
}]
}
}
});
5. Purchase. Вызывать на странице спасибо, после успешной покупки. Не выполнять еще раз, если пользователь перезагрузил страницу.
+ выполнять после покупки в 1 клик
dataLayer.push({
"event": "purchase",
'ecommerce': {
'purchase': {
'actionField': {
"id": "123456", //transaction ID
"affiliation": "Online Store", //affiliate store
"revenue": 59, //revenue
"tax": 5, //tax
"shipping": 5 //shipping
"coupon": 'SUMMER2013' // If user added a coupon code at checkout.
},
"products": [{
"id": "f6be8", //ID product
"name": "Comverges", //product name
"price": "33.00", //price
"brand": "Comverges", //brand
"category": "Adventure", //category
"variant": "full", //variant
"position": 0, //position in the list
"quantity": 1 //quantity, example: 2
}]
}
}
});