---
metadata:
  - name: generator
    content: Diplodoc Platform v5.57.4
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: https://yandex.com/support/metrica/zh/general/notification.md
    type: text/markdown
    title: Markdown version
  - href: https://yandex.com/support/metrica/zh/llms.txt
    rel: describedby
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/support/metrica/zh/llms.txt

# 关于收集统计的通知

您可以通知您的网站用户将收集统计，并推迟在网站页面上[加载 Yandex Metrica 计数器的代码片段](https://yandex.com/support/metrica/zh/general/how-it-works.md#data_extract_pull)。

如果用户同意传输信息，则计数器代码将[正常加载](https://yandex.com/support/metrica/zh/general/how-it-works.md#data_extract_pull)。 未经用户同意，将不会加载该代码片段。 用户的一次性选择可以应用于网站或域上的所有其他页面。

要启用警报并实现计数器代码的延迟加载，请联系您的网站管理员。

## 警报示例 {#exmp}

您可以使用任何文本向用户通知统计收集的情况。 请注意，以下文本仅为通知中显示文本的示例。 Yandex 不对其是否符合法律要求负责。 在发布文本前，我们建议您咨询律师。

> 本网站收集会话统计数据和访客数据。
> 
> [指向您网站的《使用条款》或《隐私政策》的链接]

## 代码实现的示例 {#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>
...
```

其中 `XXXXXXXX` 是您的计数器 ID。

<!-- source: zh/_includes/buttons/chat-button.md -->
[与我们聊天](https://yandex.com/chat/#/user/036e6a02-3620-9cdc-4c5e-a34667a7379e?utm_source=spravka){.button}

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

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

<!-- source: zh/_includes/letter-2.md -->
<div class="cut-button">

{% cut "发送电子邮件" %}

请注意：我们的支持团队永远不会主动给您打电话。 请勿按照自称为 Yandex Metrica 支持团队来电者的指示操作。


<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: zh/_includes/styles/cut-button.md -->

<!-- endsource: zh/_includes/styles/cut-button.md -->
<!-- endsource: zh/_includes/letter-2.md -->

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

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

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

<div class="borderless-table">

#|
||
实用链接

- [演示计数器](https://metrica.yandex.com/r/dashboard?)
- [添加计数器](https://metrica.yandex.com/add/)
- [免费计数器设置](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/)
- [提出您的想法](https://yandex.com/support/metrica/troubleshooting/idea.html)
|
线上培训



- [参加培训课程](https://yandex.com/adv/edu/online/metrika?utm_source=metrika_help&utm_medium=web&utm_campaign=static&utm_content=useful_links)

||
|#

</div>

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

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