How Yandex.Metrica works
Using Yandex.Metrica begins with creating a counter, which is a code snippet to insert in webpage contents. When a counter is generated, Yandex.Metrica also creates a data store associated with it.
Users interact with the webpages of a site where the counter is installed. The counter code runs and transmits data to the Yandex.Metrica service about the page itself and about events that occurred when a user interacted with it.
Collecting and transmitting data
script element, and HTML code in the
script element runs. Otherwise, the content of the
noscript element is processed.
If the page is loaded by something other than a browser (for instance, by a robot), any interpretation of the counter code is possible.
You may notice that Yandex.Metrica allows you to get more information about users and their interaction with the site pages than the counter itself 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.
The data collected by the counter is processed on Yandex.Metrica servers and supplemented with various information.
Processing and storing data
The collected data is processed by the service. Statistical objects are formed in the counter's storage based on this data.
Yandex.Metrica works with multiple data levels and uses the following types of statistical objects:
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 defining pageview attribute is the page URL of the click-through (referer), a session attribute is the session length, and a user attribute is the date of the user's first session.
These levels can be represented in a diagram:
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”.
Receiving and displaying data. 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. Yandex.Metrica lets you 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.