Description
Looker Studio supports creating reports with arbitrary dimensions and metrics. If a flattened report has multiple dimensions and only one is selected, Looker Studio will try to aggregate the columns so only a single instance of each dimension value remains in the chart.
But this only works when the right metadata is present in the connector schema (specifically, how metrics are aggregated). Currently, we set every metric to be non-re-aggregatable.
To make normal metrics in Matomo re-aggregatable:
- introduce aggregation metadata in Matomo core and fill it out for all available reports
- in the connector, set the aggregation based on this metadata
To make processed metrics in Matomo re-aggregatable:
- introduce a metadata to reveal the processed metric's formula (eg,
bounce_count / nb_visits
) - introduce mechanism to include all temporary metrics used in the computation
- in the connector
- set metric formulas based on Matomo metadata & set aggregation to AUTO
- fetch all temporary metrics
- if possible, hide temporary metrics from being used by the end user
Something to keep in mind: many processed metrics in Matomo do not use columns in the report, but other data, such as metrics in past data. These would have to be made available for Looker Studio.
Workaround
There is currently a workaround that can be used in some cases. Users that want to re-aggregate can create their own calculated field that manually specifies the aggregation, and add that with the single dimension they want.