---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
alternate:
  - https://yandex.com/support/metrica/en/objects/first-party-params-hash.md
  - https://yandex.com/support/metrica/es/objects/first-party-params-hash.md
  - https://yandex.com/support/metrica/pt/objects/first-party-params-hash.md
  - https://yandex.com/support/metrica/ru/objects/first-party-params-hash.md
  - https://yandex.com/support/metrica/tr/objects/first-party-params-hash.md
  - https://yandex.com/support/metrica/zh/objects/first-party-params-hash.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/support/metrica/en/llms.txt

# firstPartyParamsHashed (with data self-hashing capability)

<!-- source: en/_includes/code/counter-initialize/id-counter-initialize/rest-js.md -->
{% note warning %}

Working with the JavaScript API requires knowledge of HTML and JavaScript. If you don’t know these languages, contact your website developer or webmaster.

{% endnote %}
<!-- endsource: en/_includes/code/counter-initialize/id-counter-initialize/rest-js.md -->


<!-- source: en/_includes/objects/first-party-params/id-first-party-params/1.md -->
The method is available for HTTPS websites.
<!-- endsource: en/_includes/objects/first-party-params/id-first-party-params/1.md -->


<!-- source: en/_includes/objects/first-party-params/id-first-party-params/2.md -->
Sends information about site users to improve the performance of advertising algorithms and more accurate analysis of their behavior on the site. This will help you increase the effectiveness of advertising campaigns and learn more about user behavior, even if they use browsers with limited cross-site tracking cookies (third-party cookies), such as Safari and Mozilla Firefox.
<!-- endsource: en/_includes/objects/first-party-params/id-first-party-params/2.md -->


<!-- source: en/_includes/objects/first-party-params/id-first-party-params/3.md -->
After the first data transfer using this method, the **Entering contact information** goal appears in Yandex Metrica. To enable this, select [Automatic goals](https://yandex.com/support/metrica/en/general/auto-goals.md).
<!-- endsource: en/_includes/objects/first-party-params/id-first-party-params/3.md -->



{% note alert %}

Before sending data, use [data hashing](#hashing).

{% endnote %}


```javascript
ym(XXXXXXXX, 'firstPartyParamsHashed', parameters);
```


#|
||
**Parameter**
|
**Default value**
|
**Type**
|
**Description**
||
||
`parameters`*
|
—
|
Object
|
Information that the user left about themself on the site, such as through the feedback form. The previously hashed data is passed as values, except for `yandex_cid`. Example:

```javascript ym(XXXXXXXX, 'firstPartyParamsHashed', {
     "email": '<SHA‑256 from mail@example.com>',
     "phone_number": '<SHA‑256 от 70123456789>',
     "first_name": '<SHA‑256 from John>',
     "last_name": '<SHA‑256 from Smith>',
     "yandex_cid": '1000034426'
 });
```
||

||
**Fields for the parameters object**:
|
>
|
>
||
||
`email`
|
—
|
String
|
Email address [in a specific format](#hashing), hashed using the SHA-256 algorithm.

To test hashing, you can use the email `name@yandex.ru`. The hash should be: `41b86f44151924a940be6fa30d93f2471683ca74ac361d3b827a9b72c80a7623`.

If the email address is provided in unhashed form, Yandex Metrica cannot recognize it.
||
||
`phone_number`
|
—
|
String
|
Phone number [in a specific format](#hashing), hashed using the SHA-256 algorithm.

To test hashing, you can use the phone `70123456789`. The hash should be: `8f0dd3d30a1ea4b739c6217c02604aee1556025da990212759efd877206a1948`.

If the phone number is provided in unhashed form, Yandex Metrica cannot recognize it.
||
||
`first_name`
|
—
|
String
|
User’s first name.
||
||
`last_name`
|
—
|
String
|
User’s last name.
||
||
`yandex_cid`
|
—
|
Integer
|
[Unique ID](https://yandex.com/dev/id/doc/dg/api-id/reference/response.html) of Yandex user (`id`). Send it if your website uses Yandex ID authorization.
||
|#

<!-- source: en/_includes/objects/first-party-params/id-first-party-params/params_options_starred.md -->
^*^ Required parameter.
<!-- endsource: en/_includes/objects/first-party-params/id-first-party-params/params_options_starred.md -->


## Hashing data {#hashing}

Before hashing, normalize the data: ensure they are in lowercase, without commas and spaces (including double and more) at the beginning and end, as well as **email**

 
:   - For addresses on the Google domain (such as `<name>@gmail.com`), remove dots from the name. For example, replace `name.example@gmail.com` with `nameexample@gmail.com`.
    - For addresses on the Yandex domain (such as `<name>@yandex.ru`), replace dots in the name with dashes. For example, replace `name.example@yandex.ru` with `name-example@yandex.ru`.
    - Replace addresses on multiple Yandex domains (such as `@ya.ru` or `@yandex.com`) with `@yandex.ru`. For example, `example@yandex.ru`.
    - If the name uses the “+” sign (`name+commercial@example.com`), only leave the name: `name@example.com`.

**phone_number**

 
:   - The value may only contain digits.
    - In the number, replace code 8 with 7 without the “+” sign at the beginning. Example: `70123456789`.

All data except the unique Yandex user identifier (`yandex_cid`) must be hashed using the [SHA‑256](https://en.wikipedia.org/wiki/SHA-2) algorithm.

Example of parameters with hashed values:

```javascript
...
"name@yandex.ru": '41b86f44151924a940be6fa30d93f2471683ca74ac361d3b827a9b72c80a7623',
"70123456789": '8f0dd3d30a1ea4b739c6217c02604aee1556025da990212759efd877206a1948'
...
```

## Learn more

- [Checking data transmission for advanced tracking settings](https://yandex.com/support/metrica/en/objects/check-first-party-params.md)

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

{% endcut %}

</div>

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

<!-- endsource: en/_includes/styles/cut-button.md -->
<!-- endsource: en/_includes/buttons/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 -->
