Answer the question
In order to leave comments, you need to log in
How to send a transaction to Yandex.Metrica?
I can’t figure out how to send transaction data (electronic commerce) to Yandex Metrica via the API (PHP script processes purchases on the site). The following data must be sent: order amount, date, order number and products (name, price, quantity). Help make a request. We have our own user ID.
Answer the question
In order to leave comments, you need to log in
dataLayer.push({
'ecommerce' : {
'purchase' : {
'actionField' : {
'id' : 'T12345', // обязательное поле, уникальный номер транзакции
'affiliation' : 'Online Store', // название магазина
'revenue' : 100, // сумма заказа
'shipping' : 20, //доставка
},
'products' : [
{
'name' : 'НАЗВАНИЕ ТОВАРА7', // обязательное
'id' : 'АРТИКУЛ7 или ИДЕНТИФИКАТОР7', // обязательное
'price' : 100,
'brand' : 'Производитель или бренд7',
'category' : 'Категория товара',
'variant' : 'Вариант исполнения',
'quantity': 1,
'coupon' : 'Купон на скидку для товара'
}
]
}
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question