Skip to content

Conversation

@sgiehl
Copy link
Member

@sgiehl sgiehl commented Oct 9, 2025

Description

ChatGPT and Perplexity are often providing a utm_source when referring to external sites.

Matomo meanwhile detects those as AI Assistants. However, this plugin currently would overwrite the detection again as campaign, which needs to be avoided.

The implementation is very hackish, as a proper solution would need so bigger refactoring in core. This will be covered in matomo-org/matomo#20067

@sgiehl sgiehl force-pushed the dev-19575 branch 3 times, most recently from cc2f9a5 to 7bb13e8 Compare October 9, 2025 09:07
@sgiehl sgiehl requested a review from a team October 9, 2025 09:09
Copy link
Contributor

@james-hill-matomo james-hill-matomo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as a quick glance. I can run & test the code tomorrow.

Please bump the version number and update the changelog - the next release date is 2025-10-13

Copy link
Contributor

@AltamashShaikh AltamashShaikh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see the AIAssistant being tracked correctly after I checkout this PR 👍

image


yield 'utm_source param provided by Perplexity is detected as AI assistant' => [
'https://www.example.com/?utm_source=perplexity.ai',
'', // no referer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sgiehl Should we add 1 more case where utm_source is something else like should_not_be_Recorded and referrer is AI ?

Copy link
Contributor

@AltamashShaikh AltamashShaikh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left 1 optional comment, as James mentioned update the version and changelog, so that we can release it on coming Monday

Copy link
Contributor

@AltamashShaikh AltamashShaikh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left 1 optional comment, as James mentioned update the version and changelog, so that we can release it on coming Monday

@james-hill-matomo
Copy link
Contributor

This was a beautiful PR, the comments in the code anticipated any questions or complaints I might have in advance, and it's very clear.

I do wonder if "campaigns" should never have been conflated with "referrers", but it works well enough and is completely out of scope for this ticket.

@AltamashShaikh AltamashShaikh merged commit 5f2f2b6 into 5.x-dev Oct 10, 2025
7 checks passed
@AltamashShaikh AltamashShaikh deleted the dev-19575 branch October 10, 2025 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants