FAQ

Hiding sensitive data in the Reporting API

A combination of certain conditions or dimensions may constitute sensitive information, such as gender and age. In such cases, the report retains row values with 10 or more users (link).

The true value for the contains_sensetiva_data parameter means that the response contains sensitive data.

You can extend the reporting period to collect more data, or remove the conditions that retrieve sensitive information from the report.

Learn more about statistics depersonalization.

Why do the numbers I see in the Logs API and the Yandex Metrica web interface not match?

This might happen because the interface employs extra data processing algorithms. To ensure that this data is processed correctly, the system stores numbers using the IEEE 754 standard.

Warning

The IEEE 754 standard may introduce inaccuracies in arithmetic operations. To increase the precision of calculations, the system multiplies numbers by a specific factor.

Integers are handled without any loss of precision. However, the resulting values of floating-point numbers may differ from their initial values. When attempting to revert these modified numbers to their initial values, the resulting deviation depends on the level of precision allowed by the specified factor.

Fields where bids apply

Field

Bid

ym:s:purchaseRevenue

1 (also used in the Reporting API).

ym:s:goalsPrice

1000

ym:s:productsPrice

1,000,000

ym:s:impressionsProductPrice

ym:s:purchaseTax

ym:s:eventsProductPrice

What do I do if I need more than 5000 requests per tag?

  1. Make sure that you aren't requesting the same data multiple times.
  2. Review your requests to avoid making identical or similar ones.
  3. When uploading a large amount of data, schedule the upload in several parts. Start uploading each subsequent part on a different day.

To increase your quota, activate Yandex Metrica Pro.

Offline conversions and calls

What is the maximum number of rows allowed in a file?

You can include as many rows as needed, but the total file size must not exceed 1 GB.

How are static calls displayed?

Static calls aren't linked to sessions. If all calls in the file are static, the upload will result in a LINKAGE_FAILURE status. Even so, the reports will include the data.

If I send the same row multiple times with different revenue values, will the latest revenue value replace the previous one for the goal?

Yes, the most recent value will replace the previous one.

What are the restrictions for comments in uploads?

Comments can contain Latin and Cyrillic letters, as well as numbers. Your comment can't be longer than 255 characters.

Logs API

What level of Yandex Metrica access does an application require to access the Logs API?

To access the Logs API and the tag, read access is sufficient.

How to exclude robots from the Logs API data?

In the tag settings, enable robot filtering by behavior. The filter only affects data received after the filter conditions were applied. Old data won't be affected.

How does the "Cut URL parameter" operation work?

If the "Cut URL parameter" option is enabled for the tag, all removed URLs become unavailable in the Logs API as well. If you disable this operation, new data will appear in the Logs API along with URLs. However, the URLs for the previously collected data will remain inaccessible.

Reporting API

Should characters be escaped in regular expressions?

When using regular expressions in the Reporting API (for example, for segmentation), always double-escape them. For example, to send the value \.string, escape it using two slashes: \\.string.

What restrictions apply to the array of tag ids?

You can send no more than 500 tags.

Authorization via the API

What is the lifespan of a token?

The token is automatically renewed every year. The token becomes invalid if it is not used (no requests are made with it) for one year.

How do I revoke a token?

To revoke or delete a token, go to your Yandex account settings and select the Security tab. Click Log out on all devices. For more information, see Revoking a token.

Why does the "403 Access is denied" error occur?

Here are some reasons why you might see the "Access is denied" error (code 403):

  • App-side:

    • The app doesn't have access to Yandex Metrica. To read tag data (for example, to generate reports or view tag information), your app requires the metrika:read access. To manage tags (for example, to upload offline data or edit tags and segments), your app requires the metrika:write access.
  • Token-side:

    • The token is invalid. The token has expired, or the authorization password for the associated account has changed. If this is the case, reissue the token to resolve the problem.

    • The token was issued for a different account. It may have been issued for a username that doesn't have access to the Yandex Metrica tag.

      Note

      The token owner isn't the app owner. Instead, it is the account under which you were authorized when making the GET request to obtain the token.

    • The token was issued for a different account. The GET request to obtain the token contained an invalid client_id or a typo, which resulted in the token being issued for an app that doesn't have the metrika:read or metrika:write access to Yandex Metrica.

  • Yandex Metrica-side:

    • The token owner doesn't have access to the tag that you're trying to access via the API. Learn more about the types of tag access in Tag access. To use the Management API, the owner needs a guest read access or a guest write access.
  • API request-side:

    • The code for the API call contains invalid authorization parameters. This means that the token isn't being read correctly, or it's not being read at all.
Why does the 401 error occur?

The 401 error indicates that the user isn't authorized. There are two possible reasons for this:

  • The request header is missing authorization parameters.

  • The authorization parameters in the request header are incorrect.

Documentation archive

Archived documentation for the API compatible with the Google Analytics Core Reporting API

Click here to download an archived version of the documentation.