Dimensions and metrics
A dimension is an attribute of a session or hit that can be used for grouping data.
In API requests, dimensions are set in the dimensions
parameter. If you need to list multiple dimensions, separate them with commas.
You can also make a report without dimensions. In this case, the cumulative result is calculated.
A metric is a numerical value that is based on an attribute of a hit or session.
In API requests, metrics are set in the metrics
parameter. If you need to list multiple metrics, separate them with commas.
- Operating system is an attribute of a session that is used for grouping report data (a dimension).
- Page depth is a value calculated from numerical attributes of sessions (a metric) corresponding to the specified dimension.
For a better understanding of the terms “dimension” and “metric”, consider the example of a Yandex Metrica report on the operating system:
Operating system | Page depth |
---|---|
Windows | 4.2 |
IOS | 3.1 |
Linux | 1.6 |
Operating system | Page depth |
---|---|
Windows | 4.2 |
IOS | 3.1 |
Linux | 1.6 |
Where
If you are familiar with SQL, you can think of dimensions as columns used for grouping, and of metrics as the results returned by aggregate functions.
For example, the report shown above can be imagined as a query to a hypothetical table of sessions:
SELECT operatingSystem, avg(depth) from visits GROUP BY operatingSystem
You can create the desired report structure by specifying metrics and dimensions in the API request.