diff options
author | mattab <matthieu.aubry@gmail.com> | 2013-10-14 08:20:49 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2013-10-14 08:20:49 +0400 |
commit | 45933aad796c3cfcbab8c6fe4bd6d04d2dc3c3bd (patch) | |
tree | a9743e4bc5f0487dfea8722789a20e4c2e1ab770 /core | |
parent | 6a11c972c69ff80627a62adbee8afd1179424696 (diff) |
Minor
Diffstat (limited to 'core')
-rw-r--r-- | core/Tracker/Action.php | 16 | ||||
-rw-r--r-- | core/Tracker/Request.php | 16 |
2 files changed, 19 insertions, 13 deletions
diff --git a/core/Tracker/Action.php b/core/Tracker/Action.php index cba622ed99..6a47669b76 100644 --- a/core/Tracker/Action.php +++ b/core/Tracker/Action.php @@ -743,16 +743,17 @@ class Action implements ActionInterface $url = ''; } - // Site search? if ($actionType == self::TYPE_ACTION_URL) { + // Look in tracked URL for the Site Search parameters $siteSearch = $this->detectSiteSearch($url); if (!empty($siteSearch)) { $actionType = self::TYPE_SITE_SEARCH; list($actionName, $url) = $siteSearch; } + // Look for performance analytics parameters - $this->detectPerformanceAnalyticsParameters(); + $this->timeGeneration = $this->request->getPageGenerationTime(); } $actionName = self::cleanupString($actionName); @@ -918,17 +919,6 @@ class Action implements ActionInterface return array($url, $actionName, $categoryName, $count); } - const GENERATION_TIME_MS_MAXIMUM = 3600000; // 1 hour - protected function detectPerformanceAnalyticsParameters() - { - $generationTime = $this->request->getParam('gt_ms'); - if ($generationTime > 0 - && $generationTime < self::GENERATION_TIME_MS_MAXIMUM - ) { - $this->timeGeneration = (int)$generationTime; - } - } - /** * Clean up string contents (filter, truncate, ...) * diff --git a/core/Tracker/Request.php b/core/Tracker/Request.php index 8a7218979f..a26a9f1f79 100644 --- a/core/Tracker/Request.php +++ b/core/Tracker/Request.php @@ -527,4 +527,20 @@ class Request { return count($this->params); } + + + const GENERATION_TIME_MS_MAXIMUM = 3600000; // 1 hour + + public function getPageGenerationTime() + { + $generationTime = $this->getParam('gt_ms'); + if ($generationTime > 0 + && $generationTime < self::GENERATION_TIME_MS_MAXIMUM + ) { + return (int)$generationTime; + } + return false; + } + + } |