firstPartyParamsHashed (with data self-hashing capability)
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.
The method is available for HTTPS websites.
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.
After the first data transfer using this method, the “Filling in contact details” goal will appear in Yandex Metrica. To do this, enable the Automatic goals option.
Alert
Before sending data, use data hashing.
ym(XXXXXX, 'firstPartyParamsHashed', parameters);
Parameter |
Default value |
Type |
Description |
|
— |
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
|
Fields for the parameters object: |
|||
|
— |
String |
Email address in a specific format, hashed using the SHA-256 algorithm. To test hashing, you can use the email If the email address is provided in unhashed form, Yandex Metrica cannot recognize it. |
|
— |
String |
Phone number in a specific format, hashed using the SHA-256 algorithm. To test hashing, you can use the phone If the phone number is provided in unhashed form, Yandex Metrica cannot recognize it. |
|
— |
String |
User’s first name. |
|
— |
String |
User’s last name. |
|
— |
Integer |
Unique ID of Yandex user ( |
* Required parameter.
Hashing data
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, replacename.example@gmail.com
withnameexample@gmail.com
. - For addresses on the Yandex domain (such as
<name>@yandex.ru
), replace dots in the name with dashes. For example, replacename.example@yandex.ru
withname-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
.
- For addresses on the Google domain (such as
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 algorithm.
Example of parameters with hashed values:
...
"name@yandex.ru": '41b86f44151924a940be6fa30d93f2471683ca74ac361d3b827a9b72c80a7623',
"70123456789": '8f0dd3d30a1ea4b739c6217c02604aee1556025da990212759efd877206a1948'
...
Learn more
Useful links |
Online training |