---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
alternate:
  - https://yandex.ru/support/metrica/en/code/html-markup.md
  - https://yandex.ru/support/metrica/es/code/html-markup.md
  - https://yandex.ru/support/metrica/pt/code/html-markup.md
  - https://yandex.ru/support/metrica/ru/code/html-markup.md
  - https://yandex.ru/support/metrica/tr/code/html-markup.md
  - https://yandex.ru/support/metrica/zh/code/html-markup.md
title: Setting up data collection
description: 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 rules defined for a class are triggered for the element itself and all child elements unless otherwise specified.
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/support/metrica/en/llms.txt


# 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](http://www.w3schools.com/tags/att_global_class.asp) 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](https://yandex.ru/support/metrica/en/behavior/click-map.md)

**Single element**

 
:   ```xml 
    <a href="/forum/" class="ym-disable-clickmap">Forum</a>
    ```

**Container element**

 
:   ```xml 
    <ul class="ym-disable-clickmap">
     <li><a href="/events/">Events</a></li>
     <li><a href="/specials/">Best deals</a></li>
     <li><a href="/contacts/">Contacts</a></li>
    </ul> 
    ```

**Entire page**

 
:   ```xml 
    <body class="ym-disable-clickmap">
     ...
    </body> 
    ```
||
||
`ym-disable-tracklink`
|
Indicates that the link is not outbound.

Clicks on these links are not shown in the [Outbound clicks](https://yandex.ru/support/metrica/en/content/external-links.md) report.

```xml
<a href="/top-secret/" class="ym-disable-tracklink">Secret</a> 
```
||
||
`ym-disable-submit`
|
Disables tracking form data submission events.

Information about submitted form data won't 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](https://www.w3schools.com/TAGS/tag_textarea.asp) and [input](https://www.w3schools.com/TAGS/tag_input.asp) elements.

Information about filled in fields won't be shown in the [Session Replay](https://yandex.ru/support/metrica/en/webvisor/settings.md) and [Form analysis](https://yandex.ru/support/metrica/en/behavior/web-forms.md) tools.
||
||
`ym-hide-content`
|
Disables recording of user interface elements. Available only with [Session Replay](https://yandex.ru/support/metrica/en/webvisor/settings.md).
||
||
`ym-show-content`
|
Enables the recording of arbitrary site elements. Available only with Session Replay.
||
||
`ym-record-keys`
|
Enables recording the contents of fields. Available only with Session Replay. Use this class for [textarea](https://www.w3schools.com/TAGS/tag_textarea.asp) and [input](https://www.w3schools.com/TAGS/tag_input.asp) elements.
||
||
`ym-external-link`
|
Indicates that the link is outbound.

```xml
<a href="/forum/" class="ym-external-link">Forum</a>
```
||
|#

<!-- source: en/_includes/buttons/chat-button.md -->
[Chat with us](https://yandex.ru/chat/#/user/036e6a02-3620-9cdc-4c5e-a34667a7379e?utm_source=spravka){.button}

<!-- source: en/_includes/styles/href-to-button.md -->

<!-- endsource: en/_includes/styles/href-to-button.md -->
<!-- endsource: en/_includes/buttons/chat-button.md -->

<!-- source: en/_includes/common/feedback7630.md -->
<div class="cut-button">

{% cut "Write an email" %}

<!-- source: en/_includes/popup/id-popup/wrong-sup.md -->
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.
<!-- endsource: en/_includes/popup/id-popup/wrong-sup.md -->

  <div style="padding: 15px;
       margin: 10px 0;
       background: #FFFFFF;
       border-radius: 10px;
       border: 1px solid var(--g-color-line-generic);">
    <iframe style="background: #FFFFFF;"
          height="700"
          width="100%"
          frameborder="0"
          src="https://forms.yandex.ru/surveys/7630/?&iframe=1&lang=en">
    </iframe>
  </div> 

{% endcut %}

</div>

<!-- source: en/_includes/styles/cut-button.md -->

<!-- endsource: en/_includes/styles/cut-button.md -->
<!-- endsource: en/_includes/common/feedback7630.md -->


<!-- source: en/_includes/footer-links.md -->
- - -

<div class="borderless-table">

#|
||
Useful links

- [Demo tag](https://metrika.yandex.com/r/dashboard?)
- [Add a tag](https://metrika.yandex.com/add/)
- [Free tag setup](https://yandex.com/promo/freeservice/metrica?utm_source=help_metrica_ru&utm_medium=cpc&utm_campaign=1)
- [Yandex Metrica API](https://tech.yandex.com/metrika/)
- [Suggest your idea](https://yandex.com/support/metrica/troubleshooting/idea.html)
- [Discuss in Telegram](https://t.me/yandexmetrika)
|
Online training

- [Get a Yandex Metrica certificate](https://yandex.ru/adv/expert/exam/metrika/?utm_source=metrika_help&utm_medium=web&utm_campaign=static&utm_content=useful_links)


- [Take a training course](https://yandex.ru/adv/edu/online/metrika?utm_source=metrika_help&utm_medium=web&utm_campaign=static&utm_content=useful_links)

||
|#

</div>

<!-- source: en/_includes/styles/table-style.md -->

<!-- endsource: en/_includes/styles/table-style.md -->
<!-- endsource: en/_includes/footer-links.md -->

<!-- source: en/_includes/styles/href-to-button.md -->

<!-- endsource: en/_includes/styles/href-to-button.md -->

<!-- source: en/_includes/styles/cut-button.md -->

<!-- endsource: en/_includes/styles/cut-button.md -->
