S
S
SET12020-11-13 12:44:33
Yandex.Metrica
SET1, 2020-11-13 12:44:33

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

1 answer(s)
D
Danny Arty, 2020-11-13
@DanArst

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 question

Ask a Question

731 491 924 answers to any question