Presets
Presets (preset
) automatically set the metrics and dimensions that are necessary for a report.
For example, to get data for a report on browsers, use the tech_browsers
preset:
https://api-metrika.yandex.net/stat/v1/data.csv?id=44147844&preset=tech_browsers&limit=5
You can use presets with all the API methods.
In a request, presets can be used together with metrics and dimensions. In this case, an explicitly defined parameter takes priority over a preset parameter.
Use presets to create Yandex Metrica reports that are available in the web interface:
Preset usage examples
“Sources, Summary” report
preset=sources_summary
https://api-metrika.yandex.net/stat/v1/data?preset=sources_summary&id=44147844
“Sources, summary” report. Users from California
preset=sources_summary
filters=ym:s:regionAreaName=='State of California'
Report data is segmented using the parameter filters=ym:s:regionAreaName=='State of California'.
https://api-metrica.yandex.net/stat/v1/data?preset=sources_summary&filters=ym:s:regionAreaName=='State of California'&id=44147844
“Search queries” report
preset=sources_search_phrases
https://api-metrika.yandex.net/stat/v1/data?preset=sources_search_phrases&id=44147844
“Browsers” report
preset=tech_platforms
dimensions=ym:s:browser
This preset helps create a report on user browsers, without accounting for the browser version.
https://api-metrika.yandex.net/stat/v1/data?preset=tech_platforms&dimensions=ym:s:browser&id=44147844
Where the dimensions=ym:s:browser parameter sets a dimension in the preset for grouping resulting data.
Content analytics
- Traffic sources
-
You can use the preset to generate a report on the sources from which users were taken to the website's articles.
- Categories
-
Use this preset to generate a report with overall statistics by category.
preset=publishers_rubrics
https://api-metrika.yandex.net/stat/v1/data?preset=publishers_rubrics&id=44147844&date1=today&date2=today
- Authors
-
Use this preset to generate a standard report with statistics on the authors of your website's articles.
preset=publishers_authors
https://api-metrika.yandex.net/stat/v1/data?preset=publishers_authors&id=44147844&date1=today&date2=today
- Topics
-
Use this preset to generate a standard report on the topics of the website's articles.
publishers_thematics
https://api-metrika.yandex.net/stat/v1/data?publishers_thematics&id=44147844&date1=today&date2=today