diff options
author | mattab <matthieu.aubry@gmail.com> | 2015-03-26 02:57:55 +0300 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2015-03-26 02:57:55 +0300 |
commit | c75ccc6493bc90d8b9c54b1687241093faf3c210 (patch) | |
tree | 4714845075c9ac919eed41fccf9dde77a0502747 /plugins/Transitions | |
parent | dd78a2626150bcfa8e6e18f5f2ed367a416be179 (diff) |
When processing "Non exits" actions, exclude downloads/outlinks which cause a visit exit
This will fix #7539 where the "Exits" metrics was processed with a value too small
Diffstat (limited to 'plugins/Transitions')
-rw-r--r-- | plugins/Transitions/API.php | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/plugins/Transitions/API.php b/plugins/Transitions/API.php index 7092fee8f8..68c4461623 100644 --- a/plugins/Transitions/API.php +++ b/plugins/Transitions/API.php @@ -489,7 +489,7 @@ class API extends \Piwik\Plugin\API } private $limitBeforeGrouping = 5; - private $totalTransitionsToFollowingActions = 0; + private $totalTransitionsToFollowingPages = 0; /** * Get the sum of all transitions to following actions (pages, outlinks, downloads). @@ -497,7 +497,7 @@ class API extends \Piwik\Plugin\API */ protected function getTotalTransitionsToFollowingActions() { - return $this->totalTransitionsToFollowingActions; + return $this->totalTransitionsToFollowingPages; } /** @@ -578,7 +578,7 @@ class API extends \Piwik\Plugin\API protected function makeDataTablesFollowingActions($types, $data) { - $this->totalTransitionsToFollowingActions = 0; + $this->totalTransitionsToFollowingPages = 0; $dataTables = array(); foreach ($types as $type => $recordName) { $dataTable = new DataTable; @@ -591,11 +591,25 @@ class API extends \Piwik\Plugin\API Metrics::INDEX_NB_ACTIONS => $actions ) ))); - $this->totalTransitionsToFollowingActions += $actions; + + $this->processTransitionsToFollowingPages($type, $actions); } } $dataTables[$recordName] = $dataTable; } return $dataTables; } + + protected function processTransitionsToFollowingPages($type, $actions) + { + // Downloads and Outlinks are not included as these actions count towards a Visit Exit + $actionTypesNotExitActions = array( + Action::TYPE_SITE_SEARCH, + Action::TYPE_PAGE_TITLE, + Action::TYPE_PAGE_URL + ); + if(in_array($type, $actionTypesNotExitActions)) { + $this->totalTransitionsToFollowingPages += $actions; + } + } } |