Localization and interpretation of dimension values

The values of some dimensions may be given as an identifier, or as a text key. Text keys are localized, meaning they are translated to the language that is currently selected in the API.

To find out which dimensions support ID interpretation, see the Description column under Dimensions. For these dimensions, the API returns the id key, which is the ID of this dimension's value, and the name key, which is the value's description in the request language.

When filtering and using drill down, use IDs for these dimensions.

You can control the request language using the lang parameter, which is accepted by all API methods, or by selecting the top-level domain to access the API.

If the lang parameter is omitted, the en value and the international geobase are used by default. Use lang=ru in the request if:

  • The filter uses Cyrillic characters
  • Your users are in the ru domain (to ensure proper generation of the audience geography report).

Example

Let's consider the request:

https://api-metrika.yandex.net/stat/v1/data?id=44147844&dimensions=ym:s:<attribution>TrafficSource&metrics=ym:s:visits
...
{
    "dimensions": [
        {
            "id": "organic",
            "name": "Traffic from search engines"
        }
    ],
    "metrics": [
        ...
    ]
}
...

where

  • id is the ID of the ym:s:<attribution>TrafficSource value.

  • name is the description.

To filter the report by search engines, you can use this syntax: filters=ym:s:<attribution>TrafficSource=='organic'.

Traffic source values

Id

Traffic source

internal

Internal traffic

direct

Direct traffic

referral

Link traffic

organic

Search engine traffic

ad

Ad traffic

saved

Cached page traffic

undefined

Undefined

external

External links traffic

email

Mailing traffic

social

Traffic from social networks

recommend

Recommendation system traffic

messenger

Messenger traffic

qrcode

QR code traffic