-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
- Link to your site with
?pk_campaign=Campaignname
- Click on an internal site link
The second action will create a new visit. Because of that, goals in that visit won't be properly attributed.
The issue is in https://github.com/piwik/piwik/blob/master/plugins/Referrers/Columns/Base.php#L369: $visitor->getVisitorColumn('referer_name')
contains the lowercased value ("campaignname"), while $this->nameReferrerAnalyzed
contains the original value ("Campaignname"). Because of this, the fix for #9299 won't be applied and Campaign::shouldForceNewVisit
will force a new visit.
In general, this logic feels quite fragile. Is it really right to consider a changed referer_keyword
value as a sign that the campaign changed, when referer_keyword
is sometimes set by internal logic instead of directly from tracking attributes? If shouldForceNewVisit
would only look at the name & type, the workaround code could be removed.
FWIW, I agree with #9944 that create_new_visit_when_campaign_changes is counter-intuitive and should be disabled by default.