---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
alternate:
  - https://yandex.com.tr/support/metrica/en/data/visit-params-example.md
  - https://yandex.com.tr/support/metrica/es/data/visit-params-example.md
  - https://yandex.com.tr/support/metrica/pt/data/visit-params-example.md
  - https://yandex.com.tr/support/metrica/ru/data/visit-params-example.md
  - https://yandex.com.tr/support/metrica/tr/data/visit-params-example.md
title: Examples of sending session parameters
description: Transmitting traffic metrics and a hierarchical data structure, A/B testing, report on authorized and unauthorized users.
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com.tr/support/metrica/en/llms.txt


# Examples of sending session parameters


{% cut "Transmitting traffic indicators" %}

Let’s say that your site contains various articles and you want to know which authors bring the biggest audience to your site. To do this, in the parameters, you can send data about viewing a specific author:
```javascript

```

Or, for example, you may want to know which category of articles users view the most. In the parameters, you can transmit data about a category’s viewing:
```javascript

```


{% endcut %}

{% cut "Transmitting a hierarchical data structure" %} {#level}


For instance, we need to transmit data and show it in a report in a tree view.

```javascript

```


{% endcut %}

{% cut "AB testing" %} {#ab-test}


Let’s say we need to conduct an experiment to determine how the color of the **Buy** button affects the conversion rate for a **View basket** goal.

If the user is shown a red button, we use the following parameter:

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

If the user is shown a green button, we use the following parameter:

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

This parameter is transmitted in any convenient way. For example, it can be passed when initializing the tag on item pages or using the [reachGoal](https://yandex.com.tr/support/metrica/en/objects/reachgoal.md) method that is called when the **Buy** button is clicked.

After that, we'll be able to use the `ab_test` parameter value to select the corresponding data in the Yandex Metrica interface.


{% endcut %}

{% cut "Report on authorized and unauthorized users" %} {#auth}


Use the following code sample to analyze differences in the behavior of registered and non-registered site users:

```javascript

```

where XXXXXXXX is the tag ID.


{% endcut %}

<!-- source: en/_includes/buttons/chat-button.md -->
[Chat with us](https://yandex.com.tr/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/data/support-button-1.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 -->

If you need to adjust the goal so that it will continue to record events other than page views, please describe the situation in the form.

  <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.tr/surveys/10011834/?&iframe=1&lang=tr">
    </iframe>
  </div> 

{% endcut %}

</div>

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

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


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

<div class="borderless-table">

#|
||
Useful links

- [Demo tag](https://metrica.yandex.com.tr/r/dashboard?)
- [Add a tag](https://metrica.yandex.com.tr/add/)
- [Free tag setup](https://yandex.com.tr/promo/freeservice/metrica?utm_source=help_metrica_tr&utm_medium=cpc&utm_campaign=1)
- [Yandex Metrica API](https://tech.yandex.com.tr/metrika/)
- [Suggest your idea](https://yandex.com.tr/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 -->

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