yandex metrica

params vs. userParams

hist, session and customer profile attributes
As a web analyst you may want to enrich your web analytics data with various attributes (characteristics) to level up audience segmentation and deep-dive analysis capability.

Let's consider some common questions:
  • what's the difference in visitor behaviour (journey patters) between existing clients and prospects?
  • is there any difference in visitor behaviour depending on their membership in loyalty program (member vs. non-member; silver vs. platinum)
  • what is a difference between those who chose standard and premium packages, who chose annual and monthly subscription plan?
The list can be continued with marital status, age group, gender, nationality, etc. A part of this information may exist in your backend system like CRM and thus may become available once someone gets authenticated on the website. The other source of information may be the platforms like Demandbase. Questions answered in onsite forms may also contribute to the visitors profile enrichment.

Now lets see how to pass this data to Yandex Metrica and leverage this information. The platform supports two methods:
1. params - aka session parameters (that are actually hit level attributes)
2. userParams - aka visitor or user parameters

Session Parameters

Session parameters can be passed along with hits (e.g. pageviews, goals). Imagine a flat table where each row represents a hit and there is a column with a list of passed parameters. This makes it possible to label each hit and then apply a filter on them.
Yandex Metrica UI allows to search for sessions that include a hit with a given session parameter.
looking for an audience with the score higher than 2
The filter can be applied to the parameter name and its value. For example, you can filter the sessions in which there was at least one hit with the parameter name "s_score". Or include the sessions with the s_score value higher than 2 like shown in the screenshot.
If multiple values are sent within a session, all of them will be stored and then be evaluated by the filter. So if one hit was labeled with s_score=1 and the other one with s_score=3, the whole session will be returned in case a filter is set to "s_score < 2" or "s_score > 2".

The filter can't be used to retrieve hits matching the searching criteria. For example, if you are interested only in the hits labeled with s_score=1, it can't be achieved with the Metrica UI reporting capability.

User Parameters

User parameters are applied on the ClientID (and UserID) level and therefore are linked to the visitor rather than to individual hits or sessions. Think about the following descriptive characteristics: year of birth, gender, registered customer, date of first subscription, customer ID (CRM ID).
looking for qualified leads from companies with more than 500 employees
User parameters are retroactive which means they can be set at any time and will be applied to the visitor's data collected prior to this moment. Let's consider a sequence of sessions: s1 > s2 > s3.
If a user parameter is set on s2, it will be have effect on the current, past and future sessions. This concept is highly important to understand to property define the use cases for leveraging the user parameters in Yandex Metrica.
Last value overwrites the previous one. Since the user parameters are linked to the user, the last value is the one that is stored and used in the reports. Consider a scenario below for illustration.

A visitor came to a website, created an account and subscribed to a service as a regular member. The value "standard" has been sent to Yandex Metrica as the membership user parameter. After a few months that customer upgraded their subscription plan to "premium" that resulted in sending the user parameter with another value: membership = "premium". As of this moment the premium value has been applied to the user (the previous value "standard" has been overwritten and therefore disappeared from the data set). Now that user belongs to the premium membership and can't be found by applying a filter by user parameters with the condition "membership=standard" anymore.


Session and User parameters (params and userParams) are used for custom segmentation of your website audience. It's a must have part of the Yandex Metrica implementation in your roadmap for building a robust web analytics platform.

Session parameters are designed to label a session and individual hits (pageview, goal achievement, link click or file download) with helpful metadata (attributes) that you may want to use in the reports for segmenting the audience. For example, show me sessions with the signup form submission (goal) of those who faced an error (goal) with the displayed message "server_unavailable" (parameter).

User parameters are designed to characterise the visitors and customers. They are applied to all hits and sessions of the given visitor. For example, show me silver members of age 40+ who have joined the program between 2021 and 2022, and downgraded from gold membership status during that time.