Skip to content

Refactor referrer detection to be more flexible / replaceable #20067

@sgiehl

Description

@sgiehl

Our current referrer detection is hard coded into the referrer plugin, without any possibility to hook into it.
This makes it hard for plugins to manipulate that part in a useful way as it's only possible to overwrite the detected values afterwards.

I would suggest to refactor the whole detection part into a more flexible design.

First proposal:

  • Separate classes for each referrer type detection (e.g. SearchEngine, Social, Campaign, ...), all implementing a certain abstract/interface
  • Some sort of registry class, where plugins can register new referrer types, replace already registered classes or change the order of detections
  • The referrer detection will then fetch all available detections from the registry and walk through all of them, to detect the referrer details.

Once this was implemented, we need to adjust the MarketingCampaignsReporting plugin, so it's detection uses the new possibilities.

refs L3-362

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementFor new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.MajorIndicates the severity or impact or benefit of an issue is much higher than normal but not critical.Technical debtIssues the will help to reduce technical debtc: PlatformFor Matomo platform changes that aren't impacting any of our APIs but improve the core itself.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions