Switching to the new version of the Yandex Metrica tag code
There are several versions of the tag code snippet in Yandex Metrica. These versions differ in terms of the library builds they rely on: tag.js
and watch.js
. A code snippet with tag.js
offers a number of advantages:
|
tag.js |
watch.js |
Transmitting goals, session parameters, users, and other data as soon as the site starts loading, even if the tag code isn’t loaded yet. For example, if the code snippet is placed at the end of the page. |
|
: |
|
: |
|
|
: |
|
Stable operation and regular library updates |
|
: |
Using the debug panel to check if the tag collects data. |
|
: |
To switch to the tag.js
-enabled version, update the code snippet on your website:
- In Yandex Metrica, go to Settings and open the Tag tab.
- In the Code snippet section, click Copy tag code.
- Update the code on all pages of your website.
How to check which tag code version is installed on your site
Check the contents of the tag code on your website pages. Below are the key differences between tag.js
-enabled and watch.js
-enabled code snippets.
|
tag.js |
watch.js |
Contents of the |
Starts with |
Starts with |
Method |
||
Library |
|
|
Useful links |
Online training |