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-metrica.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-metrica.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

preset=sources_summary

filters=ym:s:regionCityName=='Saint Petersburg'

The report data is segmented using the parameter filters=ym:s:regionCity=='Saint Petersburg'.

https://api-metrika.yandex.net/stat/v1/data?preset=sources_summary&filters=ym:s:regionCityName=='Saint Petersburg'&id=44147844

Sources — Keywords report

This example uses request parametrization. In the preset, you must set the ID of the goal to create the report on.

preset=sources_search_phrases_goal

goal_id=<Goal ID>

https://api-metrica.yandex.net/stat/v1/data?preset=sources_search_phrases_goal&goal_id=30606884&id=44147844