Answer the question
In order to leave comments, you need to log in
Yandex.Metrica code in a separate JS file
How correct is it to put the Metrics (and Analytics) counter code into a separate JS file?
I did this and Yandex gives out an ominous inscription "The counter is not installed, but data is being received." Feeling guilty of fraud and other estimated sins.
Today I generally wrote "The counter code is not installed on the main page."
As I understand it, the counter code must be returned to the body of the page?
Answer the question
In order to leave comments, you need to log in
Finally Metrics support responded. As often happens, the answer was correct and completely useless.
- Good afternoon!
At the moment, there is no counter on the main page of the site. For correct calculation, the counter is recommended to be installed on all pages of the site and as close as possible to the top of the page.
It is necessary to install the counter code on all pages of the site between the tags, since the completeness and correctness of the calculation of Metrica indicators depends on this.
--------
An article about this case on Yandex: help.yandex.ru/metrika/code/separate-code-file.xml.
I would like a cleaner code, but still the status of the counter in this case is confusing.
I think the problem here is not that the JS code should be in the body of the main page, but that it should be connected to it and (!) run on time. Then, in theory, there should be no difference between these options from the point of view of Yandex.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question