Localization and interpretation of dimension values

The values of some dimensions may be given as IDs or as text descriptions. Text descriptions are localized, meaning they are translated into the language currently selected in the API.

To find out which dimensions support interpreting IDs, 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-metrica.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

Social media traffic

recommend

Recommendation system traffic

messenger

Traffic from messaging apps

qrcode

QR code traffic