📜 ⬆️ ⬇️

New Yandex.Metrica through API: report designer and API support for other standards

Yandex.Metrica completely rebuilt its API . Now you can not limit yourself to requesting standard report sets in search of something useful, but immediately ask a specific question, the answer to which you need.

The first API Metrics appeared some time after the web interface and was an additional functionality to it. In it were available the basic functions of the Metrics: a set of basic reports on the principle of one method = one report. The tool is useful, but inflexible, because instead of answering your questions accurately, you offered a fixed set of columns in the report without the ability to immediately filter what you need.


')
Now we have changed our approach, and the work of Metrics is completely based on the new API. That is, it became the basis of the service, and not some additional tool for it. The API works according to other principles: a set of dimensions and metrics are available in it, from which any report on the site can be built, even if it is not in the web interface. So now you can not just study the data in the reports, but also create your own analytical solutions. In addition, we supported compatibility with various API standards, including Google Analytics.

Since the work of the Yandex.Metrica service is completely based on the new API, all new tools and functions of the service immediately appear in it. For example, data segmentation, which after some time will become available to users of the web interface with the launch of Metric 2.0.

First, about the two main and for many long-awaited features that have appeared in the Metrics API, the report and segmentation designer.

Report Designer

Now, on the basis of the data that you collect on the website using the Metric, you can independently create any custom report.

How it works
With the help of the previous version of the API, you could get separate reports with data on which regions visitors came to the site, what age and sex they were, for what advertising they clicked, and so on. But they could not collect from such data a report that takes into account several factors simultaneously.

In requests to the new API, you can immediately specify all the dimensions you are interested in (dimensions) and see in the response the relationship between different factors. For example:

Details about dimensions and how to work with them require a separate story. And we will certainly share it here or in our club .

Data segmentation

General information on the site is the average temperature in the hospital, whereas for practical work the analyst is usually interested in data for individual segments of the audience.
The possibility of segmentation in the new API allows you to focus on the interesting segment of traffic and discard all unnecessary. If your target audience is men from St. Petersburg from 25 to 34 years old, you can look at the data in reports only by them: find out what sources they come from, what browsers use, what types of devices they have and so on.

How it works


Segmentation criteria can be set for more than 50 attributes of visits and hits (traffic sources, search phrases, attributes of advertising campaigns, page URLs, etc.), and conditions can be combined using AND / OR, grouped with brackets, you can specify achieved targets and attribution models and much more. All these features also deserve a more detailed story. More examples that interest you, we can make out in the comments.

Always up to date information about what is happening on the site.

In the Metric, there is practically no delay between making an event on the site and the availability of data about this event through the API. This is very useful for those who, running and testing something new on the site, faced with difficulties. Or vice versa, he wants to make sure everything goes well.

In the Metrics API, it is possible to work with fresh data in a few minutes, so that statistics updates do not have to wait for hours or days. This rate of appearance of information in reports is provided by the unique ClickHouse column DBMS - the Metrics team's own development, capable of processing requests for petabyte data volumes almost instantly.

Support for various API standards

All software interfaces are different. And the new API Metrics is designed differently than its previous API or, for example, the Google Analytics API. But this does not mean that application developers will again have to study the new API standard and implement its support.

We tried to make life easier for everyone who already has ready-made applications, and implemented support for various API standards on our side. Our new API provides a compatibility mode with Google Analytics, which allows you to connect to the Metric with minimal changes in the application code. Of course, support for the previous API Metrics is also implemented. So programs based on it do not have to make changes.

All functions of the new API are described in detail in the documentation . We will be happy to give feedback from you - study new opportunities, experiment and share interesting cases.

Source: https://habr.com/ru/post/228569/


All Articles