Setting up data collection

Yandex Metrica lets you use HTML markup to control some types of collected data. The JavaScript code of a Yandex Metrica tag reacts to the presence of classes of HTML elements (the class attribute). The rules defined for a class are triggered for the element itself and all child elements unless otherwise specified.

Class Action
ym-disable-clickmap

Disables click tracking.

Information about clicks on these elements is not collected and not displayed in the click map.

Single element
<a href="/forum/" class="ym-disable-clickmap">Forum</a>
Container element
<ul class="ym-disable-clickmap">
    <li><a href="/events/">Events</a></li>
    <li><a href="/specials/">Specials</a></li>
    <li><a href="/contacts/">Contacts</a></li>
</ul>
Entire page
<body class="ym-disable-clickmap">
    ...
</body>
ym-disable-tracklink

Indicates that the link is not external.

Clicks on these links are not shown in the Outbound links report.

<a href="/top-secret/" class="ym-disable-tracklink">Secret</a>
ym-disable-submit

Disables tracking form data submission events.

Information about submitted form data will not be shown in the Session Replay and Form Analysis tools.

ym-disable-keys

Disables recording the data entered in fields. Use this class for textarea and input elements.

Information about filled in fields will not be shown in the Session Replay 1.0, Session Replay 2.0, or Form Analysis tools.

ym-hide-content Disables recording of user interface elements. Available only with Session Replay 2.0.
ym-show-content Enables the recording of arbitrary site elements. Available only with Session Replay 2.0.
ym-record-keys Enables recording the contents of fields. Available only with Session Replay 2.0. Use this class for textarea and input elements.
ym-external-link
Indicates that the link is external.
<a href="/forum/" class="ym-external-link">Forum</a>