How to Use UTM Parameters: A Practical Guide for GA4
Most campaigns report to a channel called “direct / none.” That label is not a real answer. It…

Your analytics is lying to you. Not maliciously — but effectively. A growing share of visitors arriving from AI assistants like ChatGPT, Perplexity, Gemini, Claude, and Copilot never registers as a referral. Instead, each one quietly drops into your “direct” traffic bucket, invisible and uncounted.
This is the AI traffic attribution problem, and it’s structural. It doesn’t come from a misconfigured tag or a missing UTM. It comes from how AI apps deliver links to users — and the result is that a meaningful chunk of your real traffic is hiding in plain sight inside a number you probably trust too much.
To understand the problem you need to understand the Referer header. When someone clicks a link on an ordinary webpage, the browser sends a header to the destination telling it where that visit came from. That’s how Google Analytics, Matomo, Plausible, and every other analytics tool separates your referral traffic from direct. The whole system depends on that one header arriving intact.
AI assistants break this in several different ways simultaneously:
Referer header per the W3C Referrer Policy specification — a legacy problem that predates AI entirely but still catches people out.Referrer-Policy: no-referrer or origin on outbound links, deliberately limiting what the destination site can see.In practice, you reliably get a referrer header only when a user clicks a link in the ChatGPT or Perplexity browser web app, on a desktop browser, with no redirect in between. That’s a narrower set of conditions than most people assume. Everything else — apps, mobile, API-generated answers — produces a dark visit.
In my experience testing traffic from various AI platforms, only a minority of ChatGPT web-app clicks pass a recognizable referrer. Desktop and mobile app clicks pass almost none. The gap between “AI assisted this visit” and “AI shows in my referrals” is substantial.
The AI referral ecosystem has expanded considerably. You’re not just dealing with ChatGPT anymore. Here are the main sources to account for:
| AI Platform | Known Referrer Domain(s) | Attribution Notes |
|---|---|---|
| ChatGPT | chat.openai.com, chatgpt.com |
Web app passes referrer; desktop/mobile app doesn’t |
| Perplexity | perplexity.ai |
Web interface generally passes referrer |
| Google Gemini | gemini.google.com |
GA4 now recognizes this; other tools often miss it |
| Claude (Anthropic) | claude.ai |
Web app passes referrer when no policy override |
| Microsoft Copilot | copilot.microsoft.com |
Sidebar/app mode = no referrer; web mode = partial |
| Phind, You.com, others | Varies | Generally referrer-passing web interfaces, low volume |
The referrer domains above are the ones you can catch in your analytics when conditions align. The volume you can’t catch — app traffic, no-referrer policies, mobile hand-offs — is additional on top of these.
Additionally, each platform runs its own crawler to fetch content before serving it in answers. These crawlers identify themselves via user-agent strings (more on that below). The crawl visit and the user visit are separate events, and only one of them shows in your standard analytics.
There’s no single fix for dark traffic analytics. The approach that works is layered — combining server logs, referrer analysis, GA4 channel groups, and JavaScript detection to triangulate a picture that no single method can give you alone.
Server logs capture every request your server receives, whether the user’s analytics tag fires or not. More importantly, AI crawlers identify themselves clearly in user-agent strings, which gives you a direct measure of how much AI platform activity your site gets.
Known AI user-agent strings to search for:
| Platform | User-Agent String | Purpose |
|---|---|---|
| ChatGPT (live browsing) | ChatGPT-User |
Real-time lookup when a user asks ChatGPT to browse |
| OpenAI crawler | GPTBot |
Training and content retrieval |
| Claude | ClaudeBot |
Anthropic’s content crawler |
| Perplexity | PerplexityBot |
Answer generation citations |
| Google Gemini | Google-Extended |
AI training and serving |
| Copilot / Bing | Bingbot |
Powers Copilot answers alongside search |
Google publishes its full list of crawler user-agents, including Google-Extended. OpenAI and Anthropic document their own bots in their respective help centers. A quick command on your server gives you a raw count:
grep -E "ChatGPT-User|GPTBot|ClaudeBot|PerplexityBot|Google-Extended" /var/log/nginx/access.log | wc -l
Run that today. Most site owners are genuinely surprised by the number. For a deeper dive into what server-side data unlocks — including the ability to track visits that never fire JavaScript — see our server-side vs. client-side tracking comparison.
GA4 already recognizes traffic from gemini.google.com as a referral. However, chat.openai.com, chatgpt.com, perplexity.ai, and claude.ai don’t map to any default channel in GA4 — they fall into “Unassigned” or get collapsed into “Referral.” You fix this with a custom channel group.
Here’s how to set one up in GA4:
chat\.openai\.com|chatgpt\.com|perplexity\.ai|claude\.ai|copilot\.microsoft\.com|gemini\.google\.com|phind\.com|you\.comThis captures the referrer-passing visits — the ones where the AI web app sent the header correctly. It won’t capture the app traffic, but it gives you a reliable floor: “at least this many visits came from AI, probably more.”
For llm traffic attribution in your reporting, I’d also recommend creating a custom dimension: ai_source, populated via a Google Tag Manager trigger on session source matching the same regex. That way you can segment AI visitors across your full GA4 reports, not just channel-level data.
When a user’s browser does receive and pass a referrer from an AI platform, you can catch it with a small JavaScript snippet. This doesn’t require GTM, though GTM makes it easier to manage:
// Detect confirmed AI referrals and send to GA4 as custom event
(function () {
var ref = document.referrer.toLowerCase();
var aiDomains = [
'chat.openai.com', 'chatgpt.com',
'gemini.google.com',
'perplexity.ai',
'claude.ai',
'copilot.microsoft.com'
];
var matched = aiDomains.find(function (d) { return ref.indexOf(d) !== -1; });
if (matched && window.gtag) {
gtag('event', 'ai_referral_confirmed', {
ai_source: matched,
landing_page: window.location.pathname
});
}
})();
This only fires when a referrer is actually present — roughly 20–30% of all AI-sourced visits in my testing, depending on the platform and device mix. However, even that minority is useful. It gives you confirmed AI traffic you can compare against your “direct” segment to estimate the full hidden volume. Moreover, it’s the starting point for understanding which of your pages AI platforms cite most.
The most reliable method for chatgpt referral tracking is also the most proactive: tag your URLs before AI platforms pick them up. UTM parameters survive the referrer-stripping problem entirely because they live in the URL itself, not in headers.
Practical places to add UTM-tagged URLs:
utm_source=ai&utm_medium=llm_referral.A basic UTM structure that keeps AI traffic segmented cleanly:
https://yoursite.com/your-guide/?utm_source=chatgpt&utm_medium=ai_referral&utm_campaign=llm_citations
Use utm_source as the platform name and utm_medium=ai_referral consistently so all AI traffic rolls up into one medium in your reports. For the complete mechanics of building a UTM taxonomy that scales, see the UTM parameters masterclass.
The dark traffic analytics problem extends beyond AI. Direct traffic has always been a catch-all for attribution failures — bookmarks, offline documents, messaging apps, email clients that strip referrers, browser extension clicks. AI apps are the newest and fastest-growing addition to that list.
To estimate how much of your “direct” traffic is likely AI-sourced, look for these patterns:
/what-is-a-utm-parameter/ from memory.Additionally, segmenting first-party data by landing page type is one of the more powerful tools for identifying hidden AI attribution. Our guide on first-party data strategy covers how to structure that analysis in a cookieless context.
Not all analytics platforms handle ai referral traffic equally. Here’s a practical comparison:
| Tool | AI Referrer Detection | Server Log Access | Custom Channel Groups |
|---|---|---|---|
| GA4 | Partial (Gemini natively; others via custom group) | No (client-side only) | Yes — highly configurable |
| Matomo | Improving (dedicated AI bot tracking in recent versions) | Yes (self-hosted) | Yes |
| Plausible | Referrer-based (no dedicated AI layer) | No | Via custom properties workaround |
| Fathom | Referrer-based | No | Limited |
| Server logs (raw) | Full (user-agent based) | Always | N/A — you query directly |
GA4 is the most configurable for this use case if you invest time in custom channel groups and custom dimensions. Matomo is worth considering if you want a single tool that handles both client-side and server-log analysis. Plausible’s team has written about their approach to AI referral tracking — useful reading for anyone already on that platform.
For teams doing serious llm traffic attribution, the real answer is combining tools rather than picking one. GA4 or Plausible for client-side, server logs for the full picture, and UTM parameters to tie individual campaigns to confirmed conversions.
Honesty matters here. Even with all of the above in place — custom GA4 channel groups, JavaScript detection, server log analysis, UTM-tagged schema URLs — you will not capture every AI-sourced visit. The structural problem (no referrer header from apps) doesn’t have a client-side fix. The only complete solution would require the AI platforms themselves to pass attribution data, which some are beginning to experiment with but none have standardized yet.
What you can do is build a layered picture that’s significantly better than your current one. Server logs tell you how much AI activity your content gets. Confirmed referrers tell you which platforms send the most web-app traffic. UTM-tagged URLs in schema and feeds tell you which pieces of content get cited and drive actual clicks you can verify. Together, these give you a directionally accurate view even if the exact number stays elusive.
For a related discussion of how tracking degrades when you lose signal — and what first-party approaches preserve — see our server-side tracking explainer.
Here’s what to work through this week, in order of time investment and immediate payoff:
utm_source=chatgpt&utm_medium=ai_referral to URLs in Article and FAQ schema. This is the highest-leverage, lowest-effort UTM play for AI attribution.The sites that build an accurate picture of AI traffic now — while most competitors are still treating it as “direct” — will be the ones making better content decisions for the next few years. Attribution clarity is a strategic advantage, not just a reporting nicety.
AI traffic attribution is broken by default. Every AI app that delivers a link without a referrer header turns a real visit into a phantom — indistinguishable from someone typing your URL from memory. The scale of that problem is platform-specific and device-specific, but it affects every site getting citations from ChatGPT, Perplexity, Gemini, Claude, or Copilot.
The fix isn’t one tool or one trick. It’s a combination of server log analysis to see the full crawl and click picture, custom GA4 channel groups and JavaScript detection to catch what referrer headers do pass, and UTM-tagged URLs in structured data and feeds so future citations carry trackable parameters. No single layer catches everything. All of them together get you to a picture that’s worth acting on.
Start with the server logs. You’ll likely find the scale of this is larger than your current analytics suggest — and that information alone changes how you think about your best-performing content.
First published . Last updated .