---
metadata:
  - name: generator
    content: Diplodoc Platform v5.54.1
alternate:
  - https://yandex.com/support/metrica/en/behavior/web-forms.md
  - https://yandex.com/support/metrica/es/behavior/web-forms.md
  - https://yandex.com/support/metrica/pt/behavior/web-forms.md
  - https://yandex.com/support/metrica/ru/behavior/web-forms.md
  - https://yandex.com/support/metrica/tr/behavior/web-forms.md
  - https://yandex.com/support/metrica/zh/behavior/web-forms.md
  - href: zh/behavior/web-forms.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
title: 表单分析
description: 专为积极使用填写表单的网站设计的工具。 表单的示例包括网站上的搜索栏、订单表单或联系人表单。 表单分析有助于了解网站用户究竟如何与表单进行交互。
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/support/metrica/zh/llms.txt


# 表单分析

## 关于表单分析 {#about}

_表单分析_是专为积极使用填写表单的网站设计的工具。 表单的示例包括网站上的搜索栏、订单表单或联系人表单。 表单分析有助于了解网站用户究竟如何与表单进行交互。

该工具提供两种显示数据的方式：**Form conversion** 与 **Form fields**。

表单转化率允许您查看：
- 包含表单的页面的浏览次数。
- 与表单交互的次数。
- 提交的表单数量。

表单字段包含以下信息： 
- 与表单中的每个字段进行交互所花费的时间。
- 表单中留空的字段。
- 用户在未提交表单的情况下离开页面的字段（即在填写时造成困难的字段）。

如果分析的页面上有多个表单，您可以使用表单列表在它们之间进行切换。


## 连接 {#activate}

要使用表单分析获取数据，请执行以下步骤：

1. 在 Yandex Metrica 界面中，转到 **Settings** → **Tag**。
1. 选择 **Session Replay, scroll map, form analysis** 选项。
1. 在包含表单的网站页面上安装更新后的计数器代码。

如果满足以下条件，则可以正确从表单中收集数据：

- 网站使用 [UTF-8 编码](https://en.wikipedia.org/wiki/UTF-8)。
- `submit` 事件用于传输表单内容。
- 表单字段不隐藏（将 `display: none` 值用于 `style` 属性）。


{% note info %}

- 表单分析使用从 Session Replay 接收的数据，因此报表数量有限。 该报表显示表单上的数据 15 天（包括当天）。
    
    通常有足够的数据来接收有关用户与表单的交互的质量报表。 该系统通过录制全天的一系列会话来提供代表性样本。
    
- 通常，只有当购物篮中有产品时，订单表单才会出现在线上商店中。 要查看有关用户如何与此表单交互的报表，请在浏览器中转到商店的网站，将任意商品放入购物篮，然后转到 Yandex Metrica 中包含表单报表的页面。
        

{% endnote %}



## 页面组统计 {#group}

<!-- source: zh/_includes/behavior/click-map/id-group/group1.md -->
要查看页面组统计，您可以在 URL 框中使用额外的字符。
<!-- endsource: zh/_includes/behavior/click-map/id-group/group1.md -->

![](../_assets/map-form-url.png){.border-yes}

<!-- source: zh/_includes/behavior/click-map/id-group/group2.md -->
## 用于显示统计的字符 {#group}

#|
||
**字符**
|
**描述**
|
**示例**
||
||
\*
|
匹配任意数量的任意字符
|
显示 URL 以 https://example.com/goods/ 开头的所有页面的数据，包括指定页面：`https://example.com/goods/*`。

如果您输入的地址没有额外字符，Yandex Metrica 将提供带有 * 字符的下拉建议
||
||
~
|
条件是正则表达式
|
显示 URL 与正则表达式匹配的页面的数据。 例如，`~http://example.com/.*`
||
|#
<!-- endsource: zh/_includes/behavior/click-map/id-group/group2.md -->


让我们看一个示例： 您需要获取有关用户如何与搜索栏交互的统计。 但您感兴趣的是它们如何与所有网站页面上的搜索栏进行交互。

为了使此数据显示在 **Form Analysis** 中，请在地址框中输入 https://example.com/*（输入后，下拉建议中会显示相同的地址）。 数据会自动加载，并对具有此搜索栏的所有页面进行合计。


## 在 iframe 中显示数据 {#iframe}

如果您的网站受到保护，不会在 iframe 中显示（在服务器设置中使用 `X-Frame-Options` 标头），您将无法查看收集到的数据。 要查看网站的会话数据，请在服务器设置中使用正则表达式，以便为以下域添加例外：

- 您的网站
- metrika.yandex.ru
- metrika.yandex.by
- metrica.yandex.com
- metrica.yandex.com.tr
- webvisor.com 及其子域

```no-highlight
^https?:\/\/([^\/]+\.)?(yourdomain\.com|webvisor\.com|metri[ck]a\.yandex\.(com|ru|by|com\.tr))\/
```

如果您使用 nginx，请将以下例外添加到您的配置中：

```no-highlight
location / {
        set $frame_options '';
        if ($http_referer !~ '^https?:\/\/([^\/]+\.)?(yourdomain\.com|webvisor\.com|metri[ck]a\.yandex\.(com|ru|by|com\.tr))\/'){
            set $frame_options 'SAMEORIGIN';
        }
        add_header X-Frame-Options $frame_options;
        ...
    }
```

其中 `yourdomain\.com` 是网站的域名。 使用您网站的域区域（可能与 .com 不同）。


## 问题与解答 {#qanda}

### 不收集表单的数据 {#nodata}

如果满足以下条件，则可以正确从表单中收集数据：

- 网站使用 [UTF-8 编码](https://en.wikipedia.org/wiki/UTF-8)。
- `submit` 事件用于传输表单内容。
- 表单字段不隐藏（将 `display: none` 值用于 `style` 属性）。

### 为什么打开具有表单的页面时出错？ {#messege-nodata}

由于以下原因，具有表单的页面打开时可能会出现错误：

- 您的网站使用防止在 `iframe` 中渲染的保护（网站返回标头 `X-Frame-Options: SAMEORIGIN` 或 `X-Frame-Options: DENY`）。

  要正确回放会话，您必须删除保护代码（联系负责网站支持的人员），或配置 Web 服务器。

- 计算机或网络上的防火墙阻止访问：

   - 域 `metrika.yandex.ru` 和 `mc.yandex.ru`。
   - 域 `*.yandex.tld`。

- 如果没有 www 前缀，该网站将无法打开。
    

### 我应该怎么做才能使表单分析不对搜索表单的数据进行计数？ {#skip-form}

要从分析中排除不需要的表单，请为其分配 CSS 类 `ym-disable-submit`。

### 一个页面有多个表单，但报表仅显示其中一个表单的数据。 如何查看其他表单的数据？ {#select-form}

在页面右上角的菜单中选择要查看的表单。

### 为什么表单分析不显示在网站上填写表单的所有用户的数据？ {#number-of-records}

表单分析使用从 Session Replay 接收的数据，并且对报表数量具有相同的限制。

通常有足够的数据来接收有关用户与表单的交互的质量报表。 该系统通过录制全天的一系列会话来提供代表性样本。

### 为什么表单分析数据与其他报表中的统计不同？ {#different_data}

表单分析报表仅包含使用 `submit` 事件发送表单的页面。 如果没有，则不会计入会话。因此，表单分析报表中记录的页面浏览量和会话数可能不匹配。

此外，缺少数据可能是因为表单不在屏幕的可见区域中。 在这种情况下，用户看不到表单，并且表单分析报表不计入会话。

<!-- 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/support-3.md -->
<div class="cut-button">

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

<!-- source: zh/_includes/popup/id-popup/wrong-sup.md -->
请注意：我们的支持团队永远不会主动给您打电话。 请勿按照自称为 Yandex Metrica 支持团队来电者的指示操作。
<!-- endsource: zh/_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.com/surveys/1712/?&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/support-3.md -->


[联系我们](https://yandex-ad.cn/contact){.button}


<!-- 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 -->

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

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

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

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

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

<!-- endsource: zh/_includes/styles/border-style.md -->
