diff --git a/plugins/CustomVariables/Archiver.php b/plugins/CustomVariables/Archiver.php index 39aa9e6bb735e25196c78d24dccb4c6ab03ae321..5c5fcdf8b6c1c6e9ae4018aa94bfdfe716073703 100644 --- a/plugins/CustomVariables/Archiver.php +++ b/plugins/CustomVariables/Archiver.php @@ -245,6 +245,19 @@ class Archiver extends \Piwik\Plugin\Archiver } } + /** + * Delete Visit, Unique Visitor and Users metric from 'page' scope custom variables. + * + * - 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? + * "Actions" column is processed 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). + * + */ protected function removeVisitsMetricsFromActionsAggregate() { $dataArray = & $this->dataArray->getDataArray();