Fix calculation of action custom dimension metrics
Description:
The calculation of some metrics for action custom dimensions was not correct.
We used to fetch all metrics grouped by custom dimension value and url to be able to directly fill the subtable reports. The main report was then created by aggregating the subtable values.
This results in incorrect numbers, as e.g. metrics like nb_visits or nb_uniq_visitors can't be simply summed up. They need to be fetched separately from the database.
This PR changes the archiving, so it uses two queries. One to fetch the metrics for the main report (grouped by custom dimension value only) and another query to fetch the data for subtable reports (grouped by custom dimension value and url).
fixes #19164
Review
- [ ] Functional review done
- [ ] Potential edge cases thought about (behavior of the code with strange input, with strange internal state or possible interactions with other Matomo subsystems)
- [ ] Usability review done (is anything maybe unclear or think about anything that would cause people to reach out to support)
- [ ] Security review done
- [ ] Wording review done
- [ ] Code review done
- [ ] Tests were added if useful/possible
- [ ] Reviewed for breaking changes
- [ ] Developer changelog updated if needed
- [ ] Documentation added if needed
- [ ] Existing documentation updated if needed
If you don't want this PR to be closed automatically in 28 days then you need to assign the label 'Do not close'.
This PR was last updated more than one month ago, maybe it's time to close it. Please check if there is anything we still can do or close this PR. ping @matomo-org/core-reviewers
If you don't want this PR to be closed automatically in 28 days then you need to assign the label 'Do not close'.