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

Multiple visits logged when conflicting campaign URL parameters are used #18511

bx80 opened this issue Dec 16, 2021 · 1 comment

Multiple visits logged when conflicting campaign URL parameters are used #18511

bx80 opened this issue Dec 16, 2021 · 1 comment
Bug For errors / faults / flaws.


Copy link

bx80 commented Dec 16, 2021

If a URL containing campaign parameters with different values is tracked when the Referrers and MarketingCampaignsReporting plugins are both enabled then multiple visits will be logged for the same visitor.

For example:

It looks like first plugins\MarketingCampaignsReporting\Tracker\RequestProcessor() chooses test3 as the campaign name and also sets it as the referrer name and the referrer type as a campaign.

Then plugins\Referrers\Columns\Campaign::shouldForceNewVisit() (via plugins\Referrers\Columns\Base::detectReferrerCampaignFromTrackerParams()) uses the _rcn URL parameter to detect bing as the referrer type. Since the values don’t match a new visit is forced.

This is more obvious when there are media elements on the page sending multiple media tracking requests, where 4+ new records are created in the log_visit table for the same idvisitor withing a few seconds.

See L3-187

Expected Behavior

Only one visit should be recorded.

Current Behavior

Multiple visits are recorded.

Possible Solution

MarketingCampaignsReporting and the Referrers plugin should prioritize the campaign / referrer URL parameters in the same way so that the referrer is seen as the same and no new visit is forced.

Steps to Reproduce (for Bugs)

  1. Enable the Referrers plugin
  2. Enable the MarketingCampaignsReporting plugin
  3. On a tracked website visit a page with these URL parameters:
  4. Check the log_visit table, there will be multiple visits for the same visitor id.

(optionally for more duplicate visits: Enable the MediaAnalytics plugin, add the MediaAnalytics tracking code, then visit a tracked page using the above URL parameters where the tracked page has a few autoplaying videos)


Your Environment

  • Matomo Version: 4.6.0
  • PHP Version: 7.2
  • Server Operating System: Linux / Matomo Cloud
  • Additionally installed plugins:
@bx80 bx80 added the Bug For errors / faults / flaws. label Dec 16, 2021
@bx80 bx80 added this to the 4.8.0 milestone Dec 16, 2021
Copy link

sgiehl commented Dec 16, 2021

@bx80 We can't really prioritize the parameters the same way in core and in the plugin as they are using different config flags and classes.
A quick suggestions that comes to my mind when thinking about it would be to kind of move the CampaignDetection class from plugin to core and use it with DI in core only. That way we could replace the used class in the plugin to use other / additional detection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Bug For errors / faults / flaws.
None yet

No branches or pull requests

5 participants