diff options
Diffstat (limited to 'plugins/Heartbeat')
-rw-r--r-- | plugins/Heartbeat/Tracker/PingRequestProcessor.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/Heartbeat/Tracker/PingRequestProcessor.php b/plugins/Heartbeat/Tracker/PingRequestProcessor.php index d513e3f223..9e45e0c057 100644 --- a/plugins/Heartbeat/Tracker/PingRequestProcessor.php +++ b/plugins/Heartbeat/Tracker/PingRequestProcessor.php @@ -32,7 +32,17 @@ class PingRequestProcessor extends RequestProcessor if ($this->isPingRequest($request)) { $visitProperties->setRequestMetadata('Goals', 'someGoalsConverted', false); $visitProperties->setRequestMetadata('Goals', 'visitIsConverted', false); + // TODO: double check: can this be merged w/ setting action to null? + + // When a ping request is received more than 30 min after the last request/ping, + // we choose not to create a new visit. + if ($visitProperties->getRequestMetadata('CoreHome', 'isNewVisit')) { + Common::printDebug("-> ping=1 request: we do _not_ create a new visit."); + return true; // abort request + } } + + return false; } private function isPingRequest(Request $request) |