A
A
Andrey2011-09-21 10:45:59
JavaScript
Andrey, 2011-09-21 10:45:59

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

4 answer(s)
A
Andrey, 2011-10-20
@reaferon

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.
--------

U
UnoUmo, 2014-06-04
@UnoUmo

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.

K
korvindest, 2011-09-21
@korvindest

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.

C
ChemAli, 2011-09-21
@ChemAli

Maybe they determine the presence of a counter on the page by a simple search in the code of the issued code, but they forgot about the external connection?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question