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.

:

Session Replay

:

Content statistics

:

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:

  1. In Yandex Metrica, go to Settings and open the Tag tab.
  2. In the Code snippet section, click Copy tag code.
  3. 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 script element

Starts with function(m,e,t,r,i,k,a).

Starts with function (d, w, c).

Method

ym

yaCounter

Library

tag.js

watch.js

Chat with us

Write an email

Please note: Our support team will never initiate a call to you. Do not follow any instructions of people who call you and introduce themselves as the Yandex Metrica support team.