How Yandex Metrica works
Using Yandex Metrica begins with creating a counter, which is a code snippet to insert in webpage contents. When a tag is created, Yandex Metrica simultaneously creates a data store associated with it.
Users interact with the webpages of a site where the tag is installed. The tag code is executed and it transmits data to Yandex Metrica about the page itself and the events that occurred when the user interacted with it.
Collecting and transmitting data
The code snippet consists of two parts: JavaScript code in the script
element, and HTML code in the noscript
element.
If the page is loaded by a browser, the standard behavior is as follows. If the browser supports execution of JavaScript code and execution is not blocked by browser settings or add-ons, the JavaScript code in the script
element runs. Otherwise, the contents of the noscript
element are processed.
If the page is loaded by something other than a browser (for instance, by a robot), any interpretation of the code snippet is possible.
When the tag’s JavaScript code isn’t executed, only a limited amount of information can be collected. The Yandex Metrica server extracts session information from HTTP request headers to download an image. The link to the image is inside the noscript
element. The information that can be extracted from HTTP request headers includes the user's IP address, the URL of the page containing the image, browser and OS information, cookie data, and the absence of JavaScript support (based on the noscript
element).
When the tag’s JavaScript code is executed, much more information is available. The JavaScript code has access to information such as the HTML page title, the URL of the traffic source, parameters of the screen and the browser window, browser plug-ins and extensions (Java, Silverlight, Flash), and more. In many cases, the most significant feature of JavaScript code is that it can track events that occur while the user is interacting with the page. This includes filling in and submitting forms, clicking links, and scrolling. In addition, the JavaScript code measures page loading parameters (such as rendering time) and can transmit data about goals completed.
With Yandex Metrica you can get more information about users and their interaction with site pages than a tag can collect. For example, the browser doesn’t have information about the user’s gender, age, or locality. This information is detected by the service. Significant computing resources and large volumes of data are often used for this purpose.
In this way, data collected by a tag is processed on Yandex Metrica servers and is supplemented with various information.
Quotas
To ensure maximum service availability, Yandex Metrica imposes limitations on the number of data requests from users (quotas). Quotas are also used in the Yandex Metrica API. Web interface and the API have different quotas. Keep in mind that web interface can use API methods, thus depleting the API quota.
When the quota is exceeded, a message warning about that appears in Yandex Metrica:
- On the Dashboards page when displaying widgets. For example, if widgets are open on multiple browser tabs at the same time or multiple tag users are working with them.
- When displaying reports. For example, if several users of a tag are viewing reports or working with the same report at the same time.
A similar situation can occur if you’re simultaneously sending requests to the Yandex Metrica API and working with the web interface.
A quota may also be exceeded due to browser add-ons or malware activity. In this case, we recommend disabling your browser add-ons and checking your OS for viruses.
If you suspect that someone else made requests using your username:
- Go to your account settings.
- Under Sign in and device history, click Log out on all devices.
- Go to your account settings again and change your password. Then click Log out on all devices again.
- Wait until the unlocking conditions are met.
Quotas for Yandex Metrica web interface and unlocking conditions
Restriction |
Quota |
Lifting the quota block |
Number of requests from a single IP address |
30 per second |
When the number of requests to the API made in the last second drops below 30 |
Number of parallel requests per user ( |
3 |
When the number of parallel requests drops below 3 |
Number of requests per user ( |
5,000 per day |
At 00:00 Greenwich Mean Time (GMT) |
Number of requests per tag |
||
Number of added representatives per tag |
3 per hour |
At the start of each hour (00 minutes) |
Number of requests for access to a single tag |
Processing and storing data
The collected data is processed by the service. Statistical objects are formed in the tag’s storage based on this data.
The service continuously processes data as it arrives. Data usually becomes available for analytics in reports within 10–15 minutes after the event. In some cases, processing may take longer.
Yandex Metrica works with several data levels and operates with the following types of statistical objects:
Object |
Level |
Pageview Page loading Uploading the file Outbound click |
Basic |
Session |
Second |
User |
Third |
A statistical object is defined by a set of attributes.
Some of the attributes are shared by all types of statistical objects. For example, any type of object can have the operating system and user’s country defined, if this information was detected.
Some attributes are specific to certain types of statistical objects. For example, a characteristic attribute of a pageview is the URL of the page from which a click-through originated (the referrer), an attribute of a session is its duration, and an attribute of a user is the date of the first session.
You can transmit additional parameters to Yandex Metrica while users are interacting with the site. However, it is important to differentiate between session or pageview parameters and user parameters. User parameters differ from session or pageview parameters in that they aren’t tied to a specific time of the site session.
For example, the “send feedback” event belongs to a specific session, because the user could only submit the feedback once over the entire history of sessions. There isn’t any point in making this event a user attribute, because the reports would make it look like this user submitted the same feedback once during every session.
To compare the behavior of users who have left feedback at least once with those who have never sent feedback, you need to configure sending this event via session parameters, and then create the appropriate segments. The user parameters should only transmit attributes that don’t change from session to session, and that don’t contain users’ personal information. For instance, you can transmit the type of client: retail or wholesale.
Metrics
Each object is defined by the start time of the corresponding event (or sequence of events).
So we can select statistical objects of a specific type within a certain time period. Then we can use attribute values to calculate a variety of absolute or average numbers. These numbers are called metrics. Examples are the overall page depth, or the number of sessions with a depth greater than 5.
Metrics are always calculated for the same type of statistical objects.
A typical task when analyzing metrics is to determine how much one of the groups contributes to the total. For example, you may want to find out how many of a site's users are men, and how many are women. In Yandex Metrica, you can define groups of objects using conditions placed on attribute values, and calculate the metric values for each group. This process of breaking up a total into its parts is called dimensions.
Often you don’t need all the objects, but just those that match the specified criteria. For example, you want to analyze the behavior of users who click through from ads. In Yandex Metrica, you can form a sample of desired objects using conditions placed on attribute values. This process is called segmentation, and the selected set of objects is a segment.
Segmentation and dimensions can be used together. For example, you can select a segment of sessions that came from search engines, and group the sessions by keyword.
For viewing and analyzing metrics, reports and widgets are used. For studying user behavior, Session Replay, maps, and the form analysis service are available.
Useful links |
Online training |