---
metadata:
  - name: generator
    content: Diplodoc Platform v5.54.1
alternate:
  - https://yandex.com/support/metrica/en/data/visit-params-example.md
  - https://yandex.com/support/metrica/es/data/visit-params-example.md
  - https://yandex.com/support/metrica/pt/data/visit-params-example.md
  - https://yandex.com/support/metrica/ru/data/visit-params-example.md
  - https://yandex.com/support/metrica/tr/data/visit-params-example.md
  - https://yandex.com/support/metrica/zh/data/visit-params-example.md
  - href: zh/data/visit-params-example.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
title: 发送会话参数的示例
description: 传输流量指标和分层数据结构，A/B 测试，关于已授权用户和未授权用户的报表。
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/support/metrica/zh/llms.txt


# 发送会话参数的示例


{% cut "传输流量指标" %}

假设您的网站包含各种文章，并且您想知道哪些作者为您的网站带来了最多的受众。 为此，您可以在参数中发送有关查看特定作者的数据：
```javascript

```

或者，您可能想知道用户浏览最多的文章类别。 您可以在参数中传输有关类别浏览的数据：
```javascript

```


{% endcut %}

{% cut "传输分层数据结构" %} {#level}


例如，我们需要传输数据并将其显示在树视图的报表中。

```javascript

```


{% endcut %}

{% cut "A/B 测试" %} {#ab-test}


假设我们需要进行一个实验来确定 **Buy** 按钮的颜色如何影响 **View basket** 目标的转化率。

如果向用户显示红色按钮，我们使用以下参数：

```javascript
window.yaParams = {ab_test: "red"};
```

如果向用户显示绿色按钮，我们使用以下参数：

```javascript
window.yaParams = {ab_test: "green"};
```

此参数以任何便捷的方式传输。 例如，可以在初始化商品页面上的计数器或使用点击 **Buy** 按钮时调用的 [reachGoal](https://yandex.com/support/metrica/zh/objects/reachgoal.md) 方法时传递此参数。

之后，我们将能够使用 `ab_test` 参数值在 Yandex Metrica 界面中选择相应的数据。


{% endcut %}

{% cut "授权用户和未授权用户报表" %} {#auth}


使用以下代码示例分析注册和未注册网站用户的行为差异：

```javascript

```

其中 XXXXXXXX 是计数器编号。


{% endcut %}

<!-- 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/data/support-button-1.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/10011834/?&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/data/support-button-1.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/href-to-button.md -->

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

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

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