Skip to content

Commit

Permalink
Handling archiving of Events Full Tree (Category -> Action -> Name)
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis Monteiro committed Apr 1, 2020
1 parent 731fac5 commit 88187c6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions plugins/Events/Archiver.php
Expand Up @@ -62,6 +62,7 @@
*/
class Archiver extends \Piwik\Plugin\Archiver
{
const EVENTS_CATEGORY_ACTION_NAME_RECORD_NAME = 'Events_category_action_name';
const EVENTS_CATEGORY_ACTION_RECORD_NAME = 'Events_category_action';
const EVENTS_CATEGORY_NAME_RECORD_NAME = 'Events_category_name';
const EVENTS_ACTION_CATEGORY_RECORD_NAME = 'Events_action_category';
Expand All @@ -86,6 +87,7 @@ function __construct($processor)
protected function getRecordToDimensions()
{
return array(
self::EVENTS_CATEGORY_ACTION_NAME_RECORD_NAME => array("eventCategory", "eventAction", "eventName"),
self::EVENTS_CATEGORY_ACTION_RECORD_NAME => array("eventCategory", "eventAction"),
self::EVENTS_CATEGORY_NAME_RECORD_NAME => array("eventCategory", "eventName"),
self::EVENTS_ACTION_NAME_RECORD_NAME => array("eventAction", "eventName"),
Expand Down Expand Up @@ -261,6 +263,15 @@ protected function aggregateEventRow($row)
continue;
}
$dataArray->sumMetricsEventsPivot($mainLabel, $subLabel, $row);

if ( count($dimensions) === 3 ) {
$lastDim = $dimensions[2];
$lastLabel = $row[$lastDim];
if (empty($lastLabel)) {
continue;
}
$dataArray->sumMetricsEventsPivotTree($mainLabel, $subLabel, $lastLabel, $row);
}
}
}

Expand Down

0 comments on commit 88187c6

Please sign in to comment.