S
S
sinalp2021-11-18 19:58:44
Electronic commerce
sinalp, 2021-11-18 19:58:44

The error "dataLayer is not defined" was displayed. What should be added to the Yandex.Metrica counter code?

The error "dataLayer is not defined" was displayed.
This means that the page code on which you check the event does not have the line window.dataLayer = window.dataLayer || [];
It turns out that I need to add to the counter code in the header.php file
...


right?
but where exactly ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2021-11-18
@pro100taa

Most likely, you have incorrectly set the counter https://yandex.ru/support/metrica/data/e-commerce....
Check that the counter on your site contains the string ecommerce:"dataLayer" (or ecommerce:true). Check out the link for the rest.

S
Sergey Klimov, 2021-12-06
@Cember

It is important to set the meter code correctly. Watch carefully, because every extra character can cause incorrect display.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question