Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match with forced visitor Id (cid) only if available #35

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion core/Tracker/Visit.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class Piwik_Tracker_Visit implements Piwik_Tracker_Visit_Interface
protected $idsite;
protected $visitorKnown;
protected $request;
protected $forcedVisitorId;

// can be overwritten in constructor
protected $timestamp;
Expand Down Expand Up @@ -1163,7 +1164,7 @@ protected function recognizeTheVisitor()
// are not counted as 1 visitor. In this case, we want to enforce and trust the visitor ID from the cookie.
$trustCookiesOnly = Piwik_Config::getInstance()->Tracker['trust_visitors_cookies'];

$shouldMatchOneFieldOnly = ($matchVisitorId && $trustCookiesOnly) || !$matchVisitorId;
$shouldMatchOneFieldOnly = ($matchVisitorId && ($trustCookiesOnly || !empty($this->forcedVisitorId))) || !$matchVisitorId;

// Two use cases:
// 1) there is no visitor ID so we try to match only on config_id (heuristics)
Expand Down