Sum for custom variable in page scope is missing, see screenshot: ean - page scope languageCode - visit scope
Another problem but maybe the same bug: selected variables were tracked on every page, so actions should be "9" for all three.
Was confirmed on piwik 2.9.1 and 2.13
Thanks for the report.
- Custom variables of 'visit' scope: it is expected that these ones have the "visit" column set
- Custom variables of 'page' scope: we cannot process "Visits" count for these.
- Why? we process "Actions" column with a
SELECT count(*). A same visit can set the same custom variable of 'page' scope multiple times. We cannot sum the values of
count(*) as it would be incorrect. the way we could process "Visits" Metric for 'page' scope variable is to issue a
count(Distinct *) or so, but it is no implemented yet (this would likely be very slow for high traffic sites). it was part of initial design that we do not issue the
count(distinct *) query and that's why we do not show "Visits" metric for 'page' scope variable.
- The code that removes those metrics is in: https://github.com/piwik/piwik/blob/2.14.0/plugins/CustomVariables/Archiver.php#L213-226
Therefore it is working as expected :+1:
Another problem but maybe the same bug:
it's not the same bug, could you create a new issue with steps to reproduce? we will investigate.
Reopening - as I think we should document this behavior in the user or developer guides somewhere to prevent confusion in other users as well!
It would be useful to document this behavior directly in the UI (in report footer maybe?) , or visibly link to the help information, when this use case actually occurs (ie. when there are custom variable rows that do not have visits metrics but have actions metrics).