Tracking Referrals From ChatGPT, Perplexity and Copilot in GA4
Your AI traffic is already in GA4. It’s just scattered across four different places, none of them labelled anything useful, and a decent chunk of it is sitting in Direct where you’ll never find it.
This is the annoying reality of trying to track AI traffic in GA4 in 2026. There is no “AI Assistants” channel. Google has not added one, and given that one of the referrers you’d be measuring is a direct competitor to Google’s own product, the wait is likely to be a long one. So you build it yourself: a custom channel group, a regex that catches the hostnames as they actually arrive, and a set of annotations so that six months from now you know what changed and when.
What follows is the setup I’ve run on three client properties since early 2025, the numbers it produced, and the fairly large hole in the middle of it that nobody selling you an “AEO dashboard” wants to discuss.
What actually arrives in your property
Before building anything, look at what’s there. Reports → Acquisition → Traffic acquisition, switch the primary dimension to Session source, and search for the hostnames one at a time. On a B2B SaaS property doing roughly 40,000 sessions a month, here’s what three months of data looked like:
Session source Sessions Channel as classified by GA4
chatgpt.com 1,842 Referral
perplexity.ai 611 Referral
copilot.microsoft.com 203 Referral
gemini.google.com 189 Organic Search ← wrong
www.bing.com 2,104 Organic Search
edgeservices.bing.com 147 Referral
claude.ai 112 Referral
openai.com 88 Referral
chat.openai.com 41 Referral
------
5,337
Four things to notice. chatgpt.com and chat.openai.com are the same product across a domain migration, and both still appear. gemini.google.com gets swept into Organic Search by GA4’s default rules because it matches a google.com pattern, which means your Organic Search line is quietly inflated. edgeservices.bing.com is Copilot inside Edge’s sidebar, and it is a completely different referrer string from copilot.microsoft.com. And openai.com without the chat subdomain is usually a link from a shared conversation or an OpenAI-hosted page, not a live assistant session.
Five and a bit thousand sessions, spread across nine rows, six of which most people would scroll past. As one line item it’s 13% of traffic. As nine rows buried in a referral table it’s noise.
The channel group
Admin → Data display → Channel groups → Create new channel group. Don’t edit the Default Channel Group, GA4 lets you but you’ll regret it the moment someone else needs a clean comparison. Name it something like “Channels + AI”, create your rule, and drag it above Organic Search and Referral in the ordering. Order matters enormously: channel rules evaluate top to bottom and the first match wins, so if Organic Search sits above your AI rule, Gemini stays misclassified.
The condition is Session source → matches regex:
^(chatgpt|chat\.openai|openai|perplexity|copilot\.microsoft|
edgeservices\.bing|gemini\.google|bard\.google|claude|
you|poe|phind|andisearch|komo|iask|writesonic|
copilot\.cloud\.microsoft|m365\.cloud\.microsoft)\.
(Written on one line when you paste it. GA4’s regex field accepts it fine, it just displays badly.)
Two deliberate choices there. I’m anchoring with ^ and ending each alternative with an escaped dot so that you.com matches but a referrer like youtube.com does not. That you alternative is the reason: without the anchor and trailing dot, “you” appears inside a dozen legitimate hostnames. And I’ve included the M365 Copilot hosts because enterprise Copilot inside Word and Teams sends a different referrer again from consumer Copilot, which matters a great deal if you sell to enterprise.
One thing GA4 will not let you do: this channel group applies to data collected after you create it in some report surfaces and retroactively in others, depending on whether the report is built on the session-scoped dimension or a user-scoped one. Custom channel groups do apply retroactively to historical data in Explorations. Standard reports will show you the new grouping from creation onward. Build it now rather than next quarter, then.
Catching what the regex can’t
Here’s where the cloaking problem starts. A meaningful slice of AI referrals arrive with no referrer at all and land in Direct. The causes vary: some assistants strip the referrer for privacy, some render links inside an in-app webview that doesn’t pass one, and Perplexity’s mobile app in particular has been inconsistent about this. On the SaaS property above, the visible AI referrals were 5,337 sessions. When I cross-checked against server logs for user-agent strings containing PerplexityBot, OAI-SearchBot, ChatGPT-User and GPTBot and then looked at the human sessions that followed on the same pages, the honest estimate was that GA4 was seeing somewhere around 70 to 80% of it.
You cannot fix this inside GA4. What you can do is narrow the gap:
Add a UTM to every link you control that an assistant might surface. If you publish a comparison page and then link to it from your own docs, Reddit answers, or a Substack, tag those. It doesn’t capture the assistant referral, but it removes a source of confusion from the Direct bucket.
Watch Direct traffic to deep pages. Direct sessions landing on /guides/how-to-migrate-from-x/ are not people typing that URL. In an Exploration, set the dimension to Landing page + query string, add a filter for Session default channel group exactly matches Direct, and sort by sessions. Any long-tail URL with more than a handful of direct sessions per month is very likely assistant or LLM-sourced. On one client property this surfaced an extra 900-ish monthly sessions that the referral data had missed entirely, concentrated on exactly the three pages that ChatGPT was citing.
Compare the shape. AI-referred sessions behave distinctly. On the property above: 2.4 pages per session against a site average of 1.9, average engagement time of 2m 51s against 1m 44s, and a lead form conversion rate of 3.1% against 1.6% for organic search. Higher intent, fewer of them. If a chunk of Direct traffic to deep pages shows the same shape, that’s corroboration.
Landing page annotations
The regex tells you traffic arrived. It doesn’t tell you why, and this is the part most setups skip.
Create a custom dimension (Admin → Custom definitions → Create custom dimension), event-scoped, named “AI Citation Status”, with an event parameter of ai_citation_status. Then in GTM, fire a parameter on page_view for the pages you know are being cited, with values you maintain by hand: cited-chatgpt-comparison, cited-perplexity-pricing, not-cited, and so on.
Maintaining it by hand sounds like drudgery, and it is a bit, but the volume is small. On a 400-page site, the number of pages actually getting cited by assistants in any given month is usually between 8 and 25. You find them by running the prompts yourself: pick your fifteen highest-intent queries, run each one in ChatGPT, Perplexity and Copilot on the first of the month, log which of your URLs appear as citations, update the parameter values in GTM. Twenty minutes, monthly.
The payoff is a report you genuinely cannot get any other way. Pages tagged cited-* versus pages tagged not-cited, compared on AI-channel sessions. On the SaaS property, cited pages pulled an average of 84 AI-channel sessions a month each. Uncited pages pulled 6. That ratio is your entire argument for which pages to rewrite next, and it’s the kind of evidence that turns a content decision into a straightforward one. For the wider framework of tying this to pipeline and cost per asset, the measuring AI content performance and ROI pillar covers the attribution model this feeds into.
A second annotation worth keeping: a simple date-stamped log of every substantive edit to a cited page, held in a Google Sheet, cross-referenced against a GA4 annotation (Admin → Data display → Annotations, added natively in 2024 and still underused). When AI sessions to a page drop 40% in a fortnight, the first question is always “did we change the page?” and the answer should take four seconds to find.
What these numbers genuinely cannot tell you
Be clear-eyed about this, particularly if you’re presenting to a board that hears “AI traffic” and imagines precision.
You cannot see impressions. If ChatGPT cites your page in 4,000 answers and 200 people click through, GA4 shows you 200. The other 3,800 are brand exposure you have no instrument for. Google Search Console at least gives you impressions for organic; there is no equivalent for assistants and there probably won’t be one soon.
You cannot see the answer. The referral tells you someone clicked a link from perplexity.ai. It doesn’t tell you what question was asked, whether your page was cited approvingly or as a counter-example, or which of the six citations in that answer yours was. Nobody can retrofit this from GA4, and any tool claiming to reconstruct the prompt from your analytics is reconstructing it from their own prompt-testing, not from your traffic.
Attribution across sessions degrades badly. Someone reads a Perplexity answer citing you on Tuesday, remembers your brand, searches for you by name on Friday, converts. GA4’s default data-driven attribution will credit that conversion to Organic Search branded. The AI session was the cause. The measurement says otherwise. You can partly counter this by running a “how did you hear about us” field on your demo form, and the gap between what that field says and what GA4 says is often startling: on one client, 11% of form fills named ChatGPT or Perplexity unprompted while GA4’s last-click view attributed 4% of conversions to the AI channel.
Sampling and thresholding will bite you at low volume. If your AI channel is doing 300 sessions a month and you segment it by landing page and device, GA4 applies data thresholding when Google signals are on and will silently withhold rows. Turn off Google signals for the reporting identity if you’re doing granular AI analysis, or accept that the numbers won’t reconcile.
The first hour
If you do nothing else this week: build the channel group with the regex above, put it above Organic Search in the order, and run one Exploration comparing AI-channel sessions to organic sessions on engagement time and conversion rate for the last 90 days. That single comparison is usually enough to change how someone on your leadership team thinks about the channel, and it takes about forty minutes including the Exploration.
Then start the monthly prompt log. It’s the unglamorous half, and it’s the half that tells you what to write next.