---
metadata:
  - name: generator
    content: Diplodoc Platform v5.55.2
alternate:
  - https://yandex.com/support/metrica/en/general/notification.md
  - https://yandex.com/support/metrica/es/general/notification.md
  - https://yandex.com/support/metrica/pt/general/notification.md
  - https://yandex.com/support/metrica/ru/general/notification.md
  - https://yandex.com/support/metrica/tr/general/notification.md
  - https://yandex.com/support/metrica/zh/general/notification.md
  - href: en/general/notification.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/support/metrica/en/llms.txt

# Notice about collecting statistics

You can notify your site users that statistics will be collected, and defer [loading the code snippet for the Yandex Metrica tag](https://yandex.com/support/metrica/en/general/how-it-works.md#data_extract_pull) on site pages.

If the user agrees to have information transmitted, the tag code [loads normally](https://yandex.com/support/metrica/en/general/how-it-works.md#data_extract_pull). Without the user’s consent, the snippet won’t load. The user’s one-time choice can be applied to all the other pages on the site or domain.

To enable the alert and implement delayed loading of the tag code, contact your webmaster.

## Alert example {#exmp}

You can use any text to inform users of statistics collection. Please note that the text below is just an example of how text appears in a notification. Yandex is not responsible for its compliance with legal requirements. Before publishing the text, we recommend consulting with your lawyer.

> This site collects session statistics and visitor data.
> 
> [Link to your site's Terms of Use or Privacy policy]

## Example of code implementation {#code}


```html
...
<head>
    <meta charset="UTF-8">
    <title>Page title</title>
    <!--This example uses the reset.css style. You can use your own approach.-->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
    <!--This example uses the js-cookie library to manage cookies. You can use your own approach.-->
    
    
</head>
<body>
    Site content
    <div class="cookie-notification cookie-notification_hidden_yes">
        <div class="cookie-notification__header">Notice about collecting statistics</div>
        <div class="cookie-notification__body">
       <p>This site collects session statistics and user data.</p>
       <p>[Link to your site's user agreement or privacy policy]</p>
        </div>
        <div class="cookie-notification__buttons">
            <button class="cookie-notification__button" id="yes">I agree</button>
        </div>
    </div>
    
</body>
...
```


```html
...
<head>
    <meta charset="UTF-8">
    <title>Page Title</title>
    <!--This example uses the reset.css style. You can use your own approach.-->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
    <!--The example uses the js-cookie library for working with cookies. You can use your own approach-->
    
    
</head>
<body>
    Website Content
    <div class="cookie-notification cookie-notification_hidden_yes">
        <div class="cookie-notification__header">Statistics Collection Notice</div>
        <div class="cookie-notification__body">
       <p>This website collects visit statistics and visitor data.</p>
       <p>[Link to your website's User Agreement or Privacy Policy]</p>
        </div>
        <div class="cookie-notification__buttons">
            <button class="cookie-notification__button" id="yes">I Agree</button>
        </div>
    </div>
    
</body>
...
```

where `XXXXXXXX` is the ID of your tag.

<!-- source: en/_includes/buttons/chat-button.md -->
[Chat with us](https://yandex.com/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/letter-2.md -->
<div class="cut-button">

{% cut "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.


<div style="padding: 15px;
     margin: 10px 0;
     background: #FFFFFF;
     border-radius: 10px;
     border: 1px solid var(--yc-color-line-generic);">
  <iframe style="background: #FFFFFF;"
        height="700"
        width="100%"
        frameborder="0"
        src="https://forms.yandex.com/surveys/10011833/?&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/letter-2.md -->

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

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

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

<div class="borderless-table">

#|
||
Useful links

- [Demo tag](https://metrica.yandex.com/r/dashboard?)
- [Add a tag](https://metrica.yandex.com/add/)
- [Free tag setup](https://yandex.com/promo/freeservice/metrica?utm_source=help_metrica_en&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.com/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 -->
