diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2015-10-20 11:33:39 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2015-10-20 11:33:39 +0300 |
commit | 3eb0ce78699b49106fb414fe78e7a427de957be4 (patch) | |
tree | 7ba4ced43f219caa25549e87c05be7e53c1fec2c /plugins/CoreHome | |
parent | f903276b29689941e9ec83525cd9b35a6bdaf9e9 (diff) |
consider useAnonymizedIpForVisitEnrichment
Diffstat (limited to 'plugins/CoreHome')
-rw-r--r-- | plugins/CoreHome/Tracker/VisitRequestProcessor.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/CoreHome/Tracker/VisitRequestProcessor.php b/plugins/CoreHome/Tracker/VisitRequestProcessor.php index cb8bc98e3b..e4e5a2ddf8 100644 --- a/plugins/CoreHome/Tracker/VisitRequestProcessor.php +++ b/plugins/CoreHome/Tracker/VisitRequestProcessor.php @@ -19,6 +19,7 @@ use Piwik\Tracker\Settings; use Piwik\Tracker\Visit\VisitProperties; use Piwik\Tracker\VisitExcluded; use Piwik\Tracker\VisitorRecognizer; +use Piwik\Plugins\PrivacyManager\Config as PrivacyManagerConfig; /** * Encapsulates core tracking logic related to visits. @@ -91,8 +92,15 @@ class VisitRequestProcessor extends RequestProcessor return true; } + $privacyConfig = new PrivacyManagerConfig(); + + $ip = $request->getIpString(); + if ($privacyConfig->useAnonymizedIpForVisitEnrichment) { + $ip = $visitProperties->getProperty('location_ip'); + } + // visitor recognition - $visitorId = $this->userSettings->getConfigId($request, $request->getIpString()); + $visitorId = $this->userSettings->getConfigId($request, $ip); $request->setMetadata('CoreHome', 'visitorId', $visitorId); $isKnown = $this->visitorRecognizer->findKnownVisitor($visitorId, $visitProperties, $request); |