Counter code

You can use the options in this section to get the counter code and customize it before installing it on website pages.

Note the following counter settings:

  • Session Replay — Records and analyzes user actions on your website. More information about setting up Session Replay.
  • Scroll map — A tool for analyzing how site users pay attention to particular areas of the page.
  • Form analysis — A tool for analyzing fill-in forms (order forms, contact forms, and so on).
  • Hash tracking in the browser address bar — This option is applied for AJAX sites and allows correct calculation of the number of pageviews on pages that are updated without being refreshed.
  • Asynchronous code — Does not block pages and does not affect page loading speed.
  • For XML sites — The noscript element must not be used in XML documents.
  • Stop automatic page indexing — Webpages containing a Yandex.Metrica counter will not be indexed automatically.
  • Informer — Allows you to select the counter display mode: invisible, or showing a ticker with your site's traffic statistics. To select the type of informer and configure its appearance, click Settings.

    The informer displays data collected by the counter during the current day (this period isn't configured by the user).

  • Dispatch ecommerce data to Metrica — This option lets you enable Ecommerce via the web interface. If the option is on, by default the JavaScript array is assigned the name dataLayer. You can change it in the Name of data container field.
  • Alternative CDN — This option allows correct calculation of sessions from regions with limited access to Yandex.Metrica. Using this option may slow down the loading of the counter code.
Note.
  • If you change any counter settings, don’t forget to replace the old code on all the pages.

  • The counter transmits data to the Yandex.Metrica server over the HTTPS protocol.

  • If only the Informer code is installed on the site (<!-- Yandex.Metrika informer -->) and the counter code is not installed, statistics are not collected for the site.

Questions and answers about the informer

The informer does not display data

Check whether the informer is enabled. Go to the Settings section (on the Counter code tab) and make sure the Informer option is selected. If this option is disabled, save changes after enabling it and update the counter code on the website pages.

The label “Yandex.Metrica” is shown instead of the informer

Check whether the website where you are expecting to see the informer has been added as an additional domain in the counter settings. Without this setting, data is not displayed.