diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-06-18 03:43:02 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-06-18 03:43:02 +0400 |
commit | e6459f116f3cdc68580d57766e882f55799589c9 (patch) | |
tree | 07394456be99739cb6445ca2d86d122d8ad98dba /core/Tracker/Visit.php | |
parent | 2fce8c61334bae346ddebd78dd98679f22326e01 (diff) |
this should fix the tests, in case of new visits the idvisitor was not set
Diffstat (limited to 'core/Tracker/Visit.php')
-rw-r--r-- | core/Tracker/Visit.php | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/core/Tracker/Visit.php b/core/Tracker/Visit.php index be3f415b52..57b4ecac3c 100644 --- a/core/Tracker/Visit.php +++ b/core/Tracker/Visit.php @@ -81,10 +81,9 @@ class Visit implements VisitInterface public function handle() { // the IP is needed by isExcluded() and GoalManager->recordGoals() - $ip = $this->request->getIp(); - $this->visitorInfo['location_ip'] = $ip; + $this->visitorInfo['location_ip'] = $this->request->getIp(); - $excluded = new VisitExcluded($this->request, $ip); + $excluded = new VisitExcluded($this->request, $this->visitorInfo['location_ip']); if ($excluded->isExcluded()) { return; } @@ -186,7 +185,7 @@ class Visit implements VisitInterface } // When the row wasn't found in the logs, and this is a pageview or // goal matching URL, we force a new visitor else { - $visitor->setIsVisitorKonwn(false); + $visitor->setIsVisitorKnown(false); } } } @@ -295,12 +294,15 @@ class Visit implements VisitInterface { Common::printDebug("New Visit (IP = " . IP::N2P($this->getVisitorIp()) . ")"); - $idVisitor = $this->getVisitorIdcookie($visitor); - $this->visitorInfo = $this->getNewVisitorInformation($idVisitor); + $this->visitorInfo = $this->getNewVisitorInformation($visitor); // Add Custom variable key,value to the visitor array $this->visitorInfo = array_merge($this->visitorInfo, $this->visitorCustomVariables); + foreach ($this->visitorInfo as $key => $value) { + $visitor->setVisitorColumn($key, $value); + } + $dimensions = VisitDimension::getAllDimensions(); $this->triggerHookOnDimensions($dimensions, 'onNewVisit', $visitor, $action); @@ -485,10 +487,10 @@ class Visit implements VisitInterface Common::printDebug($debugVisitInfo); } - protected function getNewVisitorInformation($idVisitor) + protected function getNewVisitorInformation($visitor) { return array( - 'idvisitor' => $idVisitor, + 'idvisitor' => $this->getVisitorIdcookie($visitor), 'config_id' => $this->getSettingsObject()->getConfigId(), 'location_ip' => $this->getVisitorIp(), ); @@ -509,6 +511,7 @@ class Visit implements VisitInterface // Might update the idvisitor when it was forced or overwritten for this visit if (strlen($this->visitorInfo['idvisitor']) == Tracker::LENGTH_BINARY_ID) { $valuesToUpdate['idvisitor'] = $this->visitorInfo['idvisitor']; + $visitor->setVisitorColumn('idvisitor', $this->visitorInfo['idvisitor']); } $dimensions = VisitDimension::getAllDimensions(); |