You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Columns/CampaignName.php
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -51,6 +51,20 @@ public function shouldForceNewVisit(Request $request, Visitor $visitor, Action $
51
51
$campaignParameters
52
52
);
53
53
54
+
// Never start a new visit, if the visit was detected as AI Assistant by core, unless
55
+
// there are campaign parameters detected, that do not resolve to an AI Assistant.
56
+
// This is a hacky workaround to solves issues where randomly new visits are started when
57
+
// e.g. someone comes from ChatGPT having the `utm_source=chatgpt.com` url parameter.
58
+
// That one will be detected as AI Assistant by core. But if someone reloads that page
59
+
// and the utm source is still present, the check here might otherwise force a new visit,
60
+
// if the `utm_source` parameter is configured.
61
+
if ((int)$visitor->getVisitorColumn('referer_type') === 8 && count($campaignDimensions) === 1) {
62
+
$paramValue = reset($campaignDimensions);
63
+
if (class_exists('Piwik\Plugins\Referrers\AIAssistant') && \Piwik\Plugins\Referrers\AIAssistant::getInstance()->getAIAssistantFromDomain($paramValue)) {
64
+
returnfalse;
65
+
}
66
+
}
67
+
54
68
// we force a new visit if the referrer is a campaign and it's different than the currently recorded referrer.
55
69
// if the current referrer is 'direct entry', however, we assume the referrer information was sent in a later request, and
56
70
// we just update the existing referrer information instead of creating a visit.
Copy file name to clipboardExpand all lines: plugin.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
{
2
2
"name": "MarketingCampaignsReporting",
3
3
"description": "Measure the effectiveness of your marketing campaigns. New reports, segments & track up to five channels: campaign, source, medium, keyword, content.",
0 commit comments