Skip to content

[Enhancement] Enhance social media attribution #24570

@SW-Vincent

Description

@SW-Vincent

Social media traffic is currently identified only through the referrer domain. As a fallback, app traffic is currently classified as direct traffic.
It would be interesting to also attribute traffic to social media based on click IDs and user agent.

Summary

Here is the workflow I had in mind (assuming there is no UTM or equivalent within the landing page URL).
It is basically about adding a few fallbacks for social media attribution :

  • if referrer matches a social network AND contains search query parameters → classify as search engine traffic (unchanged)
  • else if referrer matches social THEN social media (unchanged)
  • else if no referrer but social click ID* (such as fbclid) is present within the landing page URL THEN social media (previously counted as direct traffic, although they are detected as we can see in visit log)
  • else if no referrer but in-app social media identifiers** are present within user agent, THEN social media

Lets take Facebook as an example :

  • The presence of fbclid query parameter indicates that the visit comes from Facebook, even without referrer ;
  • The presence of [FBAN/FB4A;FBAV/version-number] indicates that the visit has been made from the in-app browser of Facebook for Android.

It would be relevant to change the current conversion table from the current format :

[...]
Facebook:
  - facebook.com
  - fb.me
  - m.facebook.com
  - l.facebook.com
 [...]

To an object such as (for example) :

[...]
Facebook:
  referrerDomains:
    - facebook.com
    - fb.me
    - m.facebook.com
    - l.facebook.com
  clickIds:
    - fbclid
  userAgentPatterns:
    - FBAN/FB4A
    - FBAN/FBIOS
 [...]

And of course adjust how the table is handled in consequence.

Relevant files :

Your Environment

  • Matomo Version: Mostly Cloud
  • PHP Version:
  • Server Operating System:
  • Additionally installed plugins:

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementFor new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions