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 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 a description of the value 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.
Example
Let's look at the following request:
https://api-metrika.yandex.net/stat/v1/data?id=44147844&dimensions=ym:s:<attribution>TrafficSource&metrics=ym:s:visits
...
{
"dimensions": [
{
"id": "organic",
"name": "Переходы из поисковых систем"
}
],
"metrics": [
...
]
}
...
where
id
is the ID of theym: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 |
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 |