Answer the question
In order to leave comments, you need to log in
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
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.
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 questionAsk a Question
731 491 924 answers to any question