Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiosmosis <benaka@piwik.pro>2015-06-06 09:40:26 +0300
committerdiosmosis <benaka@piwik.pro>2015-06-25 14:13:34 +0300
commitd10b204a678a3285e6ecc513580ec7d201de8667 (patch)
tree40c9140424958d667701d7c167a6deaa7c8fa614 /core/Tracker/Visit.php
parentd94551c4f33756f8245acd9fb9720382ae997f55 (diff)
Adding server side logic for ping requests that specify a visit is still ongoing, w/o creating a new action. Includes a new integration test for the feature.
Diffstat (limited to 'core/Tracker/Visit.php')
-rw-r--r--core/Tracker/Visit.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/Tracker/Visit.php b/core/Tracker/Visit.php
index 2ae3e0677d..6a33b93f52 100644
--- a/core/Tracker/Visit.php
+++ b/core/Tracker/Visit.php
@@ -158,6 +158,14 @@ class Visit implements VisitInterface
$isNewVisit = $this->isVisitNew($visitor, $action);
+ // on a ping request that is received before the standard visit length, we just update the visit time w/o
+ // adding a new action
+ if ($this->isPingRequest()
+ && !$isNewVisit
+ ) {
+ $action = null;
+ }
+
// Known visit when:
// ( - the visitor has the Piwik cookie with the idcookie ID used by Piwik to match the visitor
// OR
@@ -700,4 +708,9 @@ class Visit implements VisitInterface
return $site['timezone'];
}
}
+
+ private function isPingRequest()
+ {
+ return $this->request->getParam('ping') == 1;
+ }
}