---
metadata:
  - name: generator
    content: Diplodoc Platform v5.54.5
alternate:
  - https://yandex.com/support/metrica/en/data/user-params-example.md
  - https://yandex.com/support/metrica/es/data/user-params-example.md
  - https://yandex.com/support/metrica/pt/data/user-params-example.md
  - https://yandex.com/support/metrica/ru/data/user-params-example.md
  - https://yandex.com/support/metrica/tr/data/user-params-example.md
  - https://yandex.com/support/metrica/zh/data/user-params-example.md
  - href: en/data/user-params-example.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
title: Examples of sending user parameters
description: Sending your own data in a CSV file, sending data about user type (customer or partner), sending data from a field in a form.
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/support/metrica/en/llms.txt


# Examples of sending user parameters

## Sending your own data in a CSV file {#example1}

Consider the case of an online book store. In addition to order information such as total amounts and items sold, the website owner also has detailed information about customers: their age, whether they have children, and their children’s ages.

The site owner wants to analyze and use the information about children's ages. The site doesn’t use its own customer ID system.

**Step 1. Prepare and send the data**

 
:   Since the age information is stored in a database, we need to form a CSV file in order to send this data to Yandex Metrica.
    
    1. Since you aren't using your own customer ID system, request the site user ID assigned by Yandex Metrica. To do this, use the [getClientID](../objects/get-client-id.md) method.
        
        ```javascript
        ym(XXXXXXXX, 'getClientID', function(clientID) {
        <function body>
        });
        ```
        
        You get a response:
        
        ```javascript
        "12345"
        ```
        
        where
        
        - `XXXXXXXX` is a tag ID.
        - `12345` is a string value.
        
    1. Export the data you got and create a file with additional information about site users.
        
   ![](../_assets/up-csv-example.png){.border-yes}
        
    
    Then upload the file you prepared to Yandex Metrica and get your report.
    
    The report shows that users have children ages 8–13. These are school-age children, so we can advertise school-related items before the beginning of the school year.

**Step 2. Use the data in Yandex Metrica**

 
:   To create a segment based on the sent user parameters in the Yandex Metrica interface:
    
    1. Go to any report, for example, [Sources, summary](../sources/sources-summary.md).
	
    1. <!-- source: en/_includes/general/segmentation-examples/id-segmentation-examples/1.md -->
       In the **for people with** condition group, click ![](../_assets/plus-segment.png).
       <!-- endsource: en/_includes/general/segmentation-examples/id-segmentation-examples/1.md -->
        
    1. Select the condition: **Characteristics** → **User parameters**.
	
    1. Specify the parameter you need.
	
## Sending data about user type (customer or partner) {#example2}

In this case, you can differentiate users by whether they used the **Customer sign in** or **Partner sign in** link. Just like when you send data from your own database, you need to add special code to the page. This code will check the referrer (the link the user clicked to get to the login page) and send that information to the `userParams` method:


{% list tabs %}

- Customer

  
  ```javascript
  ym(XXXXXXXX, 'userParams', {
       status: "client"
  });
  ```
  

- Partner

  
  ```javascript
  ym(XXXXXXXX, 'userParams', {
       status: "partner"
  });
  ```

{% endlist %}


<!-- source: en/_includes/data/user-params-data/id-online/counter-number.md -->
where `XXXXXXXX` is the ID of your tag.
<!-- endsource: en/_includes/data/user-params-data/id-online/counter-number.md -->


## Sending data from a field in a form {#example3}

**Site registration using a form**

 
:   Let's say you have an online magazine for pet lovers. During registration, users can specify what kind of pet they have. In this case, we can get the data from the field on the form that users fill in:
    
    ```javascript
    ym(XXXXXXXX, 'userParams', {pet: "dog"});
    ```

**Sending a request from a form**

 
:   Let’s say that a food delivery company wants to analyze revenue from users in different parts of the city separately. We know that customers usually order deliveries to the same address, so the part of the city can be moved to the user level:
    
    ```javascript
    ym(XXXXXXXX, 'userParams', {delivery: "Arbat"});
    ```

<!-- 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/reports/support-button.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 -->

<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/1705/?&iframe=1&lang=en">
  </iframe>
</div>

{% endcut %}

</div>



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

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

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

<!-- endsource: en/_includes/styles/href-to-button.md -->
<!-- endsource: en/_includes/reports/support-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 -->
