public function processRequestParams(VisitProperties $visitProperties, Request $request)
 {
     // the IP is needed by isExcluded() and GoalManager->recordGoals()
     $visitProperties->setProperty('location_ip', $request->getIp());
     // TODO: move VisitExcluded logic to here (or move to service class stored in DI)
     $excluded = new VisitExcluded($request, $visitProperties->getProperty('location_ip'));
     if ($excluded->isExcluded()) {
         return true;
     }
     // visitor recognition
     $visitorId = $this->userSettings->getConfigId($request, $visitProperties->getProperty('location_ip'));
     $request->setMetadata('CoreHome', 'visitorId', $visitorId);
     $isKnown = $this->visitorRecognizer->findKnownVisitor($visitorId, $visitProperties, $request);
     $request->setMetadata('CoreHome', 'isVisitorKnown', $isKnown);
     $isNewVisit = $this->isVisitNew($visitProperties, $request);
     $request->setMetadata('CoreHome', 'isNewVisit', $isNewVisit);
     return false;
 }
Exemplo n.º 2
0
 public function processRequestParams(VisitProperties $visitProperties, Request $request)
 {
     // the IP is needed by isExcluded() and GoalManager->recordGoals()
     $visitProperties->setProperty('location_ip', $request->getIp());
     $excluded = new VisitExcluded($request);
     if ($excluded->isExcluded()) {
         return true;
     }
     $privacyConfig = new PrivacyManagerConfig();
     $ip = $request->getIpString();
     if ($privacyConfig->useAnonymizedIpForVisitEnrichment) {
         $ip = $visitProperties->getProperty('location_ip');
     }
     // visitor recognition
     $visitorId = $this->userSettings->getConfigId($request, $ip);
     $request->setMetadata('CoreHome', 'visitorId', $visitorId);
     $isKnown = $this->visitorRecognizer->findKnownVisitor($visitorId, $visitProperties, $request);
     $request->setMetadata('CoreHome', 'isVisitorKnown', $isKnown);
     $isNewVisit = $this->isVisitNew($visitProperties, $request);
     $request->setMetadata('CoreHome', 'isNewVisit', $isNewVisit);
     return false;
 }