createNewVisitWhenCampaignChanges = TrackerConfig::getConfigValue('create_new_visit_when_campaign_changes') == 1; } public function getName() { return Piwik::translate('Referrers_ColumnCampaign'); } /** * If we should create a new visit when the campaign changes, check if the campaign info changed and if so * force the tracker to create a new visit. * * @param Request $request * @param Visitor $visitor * @param Action|null $action * @return bool */ public function shouldForceNewVisit(Request $request, Visitor $visitor, Action $action = null) { if (!$this->createNewVisitWhenCampaignChanges) { return false; } $information = $this->getReferrerInformationFromRequest($request); if ($information['referer_type'] == Common::REFERRER_TYPE_CAMPAIGN && $this->isReferrerInformationNew($visitor, $information) ) { Common::printDebug("Existing visit detected, but creating new visit because campaign information is different than last action."); return true; } return false; } }