Skip to content

Campaign name with capitals will create duplicate visits #12250

@laszlovl

Description

@laszlovl
  1. Link to your site with ?pk_campaign=Campaignname
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugFor errors / faults / flaws / inconsistencies etc.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions