To track ChatGPT referral traffic in GA4, create a custom channel group in Admin, add a channel called AI Referrals with the condition Session source matches regex chatgpt\.com|perplexity\.ai|claude\.ai|gemini\.google\.com|copilot\.microsoft\.com, drag that channel above Referral in the priority order, then report on it in a Free Form exploration. GA4's native AI Assistants channel covers part of this, but not Perplexity and not your history.
Most teams find out they have AI traffic by accident. Someone spots utm_source=chatgpt.com in a landing page report, or a sales rep hears "I found you through ChatGPT" on a discovery call, and suddenly there is a question nobody can answer with the reports they have. This post is the implementation side of that problem: the exact GA4 configuration, the regex, the exploration setup, and the caveats that quietly break both. If you want the strategic layer instead, which prompts to track, what share of voice means, and how to build a reporting cadence around AI visibility, read our companion piece on how to measure LLMO and AI visibility. Everything below assumes you have already decided AI traffic matters and you just want it counted correctly.
Why AI Traffic Still Hides in Direct and Referral
Three separate things go wrong before a click from an AI assistant reaches a report you trust. First, the referrer header often does not survive the click. Links opened inside the ChatGPT iOS and Android apps launch in an embedded web view, and the handoff drops the Referer header. Copy and paste does the same thing. So does a noreferrer attribute on the link. Independent 2026 analyses of AI referral sessions put the share arriving with no referrer header at anywhere from a third to roughly seventy percent, depending on the site's audience mix and how mobile heavy it is. All of that lands in Direct, indistinguishable from someone typing your domain from memory.
Second, the platforms behave differently. ChatGPT has appended utm_source=chatgpt.com to citation links since 2025, which is why ChatGPT is the one AI source most GA4 properties can already see. Perplexity, Claude, and Gemini generally do not append campaign parameters, so they depend entirely on the referrer surviving. That single difference explains why ChatGPT looks like it accounts for nearly all AI referrals in raw GA4 data while third party clickstream panels show a much more mixed picture.
Third, GA4's channel logic was not designed for this. A URL carrying utm_source with no utm_medium gives GA4 a source but no medium to match against a channel definition, which is how AI sessions ended up in Unassigned on so many properties. Google has partly fixed that, which is the next section.
What GA4's Native AI Assistants Channel Covers
In May 2026 Google added AI Assistants as a default channel group. It needs no setup. When an incoming click matches Google's internal list of AI assistant referrers, GA4 overwrites the medium to ai-assistant and the campaign to (ai-assistant), and the session is grouped under AI Assistants. Google's default channel group documentation names ChatGPT, Gemini, DeepSeek, Copilot, and Grok, and explicitly excludes Google's own AI Overviews and AI Mode, which stay inside Organic Search.
That is real progress and it removes the Unassigned problem for the named platforms. It also has three limits worth knowing before you tell your CMO the number is now correct. It is forward only, so sessions processed before the rollout stay classified under whatever channel they originally got. It does not include Perplexity in the published list, and Perplexity is one of the higher intent AI sources, so those sessions still sit in Referral. And it cannot recover sessions with no referrer and no UTM, because there is nothing for the rule to match on. You still need a custom channel group, both as a fallback and because a custom group is applied at query time and therefore works on historical data.
Step 1: Audit What Is Already Landing in Your Property
Before you build anything, find out what your property is actually receiving. Open Reports, Acquisition, Traffic acquisition, switch the primary dimension to Session source, set the date range to the last 90 days, and use the search box on the table to filter for chatgpt, then perplexity, then claude, then gemini. Write down the exact strings GA4 returns. This matters because the host you assume and the host GA4 records are not always the same, and a regex built on assumptions silently matches nothing.
Then check Reports, Engagement, Landing page with the dimension set to Landing page + query string and search for utm_source=chatgpt.com. Compare the session count there with the session count you saw under the chatgpt.com source. If landing page hits are meaningfully higher than attributed sessions, the gap is your UTM being present while attribution is being assigned elsewhere, usually because the visitor was mid session already. If they roughly match, your ChatGPT attribution is healthy and your real problem is the platforms that do not tag links.
Fix data retention now, not later. GA4 defaults event level retention to 2 months, and explorations only reach back as far as that setting. Go to Admin, Data settings, Data retention and set it to 14 months. It is free, it is one click, and without it the exploration you are about to build has almost no history to draw on.
Step 2: Build the AI Referrals Custom Channel Group
Go to Admin, Data display, Channel groups, Create new channel group. Name it something plain like AI and Organic. GA4 gives standard properties two custom channel groups with up to 25 channels each, and Analytics 360 gives five, so do not burn a group on a single rule you will regret.
Create a new channel named AI Referrals and add two OR conditions. Condition one: Session source matches regex with this pattern.
(?i)^(chatgpt\.com|chat\.openai\.com|openai\.com|perplexity\.ai|www\.perplexity\.ai|claude\.ai|gemini\.google\.com|bard\.google\.com|copilot\.microsoft\.com|grok\.com|chat\.deepseek\.com|meta\.ai|chat\.mistral\.ai)$
Condition two, joined with OR: Session medium exactly matches ai-assistant. That second condition future proofs the channel against Google adding platforms to its own list, because once GA4 rewrites the medium your source based rule may no longer be the thing doing the work.
Three configuration details decide whether this works. Channel matching in GA4 is case sensitive, which is why the pattern starts with the (?i) inline flag rather than assuming lowercase. The anchors keep perplexity\.ai from matching a lookalike domain someone parks later. And priority order is evaluated top down with first match winning, so drag AI Referrals above Referral, Organic Search, and Unassigned. If it sits below Referral, it will report zero forever and you will spend an afternoon debugging a regex that was fine.
One more decision. GA4 lets you promote a custom group to be the primary channel group used in standard reports. Promoting it is forward looking only, so historical rows keep their old classification, while leaving it as a secondary group means it stays fully retroactive in explorations. For most teams the right call is to leave it unpromoted for the first quarter, validate the numbers, then promote.
Step 3: Build the Free Form Exploration
Standard reports will now show the channel, but they will not answer the question you actually have, which is which pages AI assistants send people to and what those people do next. Go to Explore, Blank, Free form and configure it exactly like this.
Dimensions to import: your custom channel group name, Session source, Session medium, Session campaign, Landing page + query string, and Device category. Metrics to import: Sessions, Engaged sessions, Average engagement time per session, Key events, and Session key event rate. Rows: Landing page + query string. Columns: Session source. Values: Sessions and Key events.
Then build a session scoped segment. Create a new segment, choose Session segment, and set the condition to your custom channel group exactly matches AI Referrals. Apply it to the tab. You now have a table of the pages AI assistants are actually citing, split by which assistant sent the click, with conversion attached. That is the report worth putting on a weekly cadence. Add a second tab with Rows set to Session source and a date breakdown to watch platform mix shift over time, because it is shifting fast: clickstream panels through 2026 show ChatGPT still dominant in absolute referral volume while Claude, Gemini, and Perplexity take a growing slice.
Step 4: Recover the AI Sessions Sitting in Direct
Everything above only catches sessions where a source survived. For the rest, you need to capture the referrer yourself before GA4 makes its attribution decision. In Google Tag Manager, create a Custom JavaScript variable that reads document.referrer and the current URL query string, tests both against the same list of AI hosts plus utm_source=chatgpt, and returns a clean label like chatgpt, perplexity, or none. Attach it as an event parameter, for example ai_referrer, on your GA4 configuration tag so it rides along on every event. Then register it in Admin, Custom definitions as an event scoped custom dimension. Standard properties allow 50 of those, so there is room.
Two things this buys you. It survives cases where GA4 has already decided the session is Direct, because your parameter is independent of session attribution. And it captures the in app browser cases where the URL still carries utm_source=chatgpt.com but the referrer is gone, which is a surprisingly large slice of mobile AI traffic. Cross check by adding Page referrer as a dimension in a second exploration filtered to Direct sessions. If Page referrer shows AI hosts on sessions classified as Direct, you have quantified your blind spot rather than guessed at it.
Do not try to solve this with the referral exclusion list, and do not add AI hosts to it. That list tells GA4 to ignore a referrer, which is the opposite of what you want here.
Step 5: UTM Caveats and Reporting That Survives Scrutiny
Redirects strip parameters. If your CMS or CDN redirects example.com/page?utm_source=chatgpt.com to a canonical URL without preserving the query string, the UTM never reaches the GA4 tag and the session becomes Direct. Test every redirect rule with a query string attached before blaming the platform.
Do not rewrite ChatGPT's parameter. Some teams add utm_medium=ai server side to make channel rules simpler. That breaks comparability with every benchmark and with GA4's own AI Assistants classification. Match on source, and let the medium be whatever GA4 sets.
Consent mode changes the denominator. On properties with consent banners, sessions from users who decline analytics storage are modeled or missing entirely, and AI referral volume is small enough that a few hundred missing sessions visibly distorts the trend. Report AI traffic as share of total sessions alongside absolute numbers so the denominator moves with it.
Report outcomes, not sessions. AI referral volume is still small on most B2B sites, often low single digit percentages of total sessions. What makes it worth the setup is that the traffic converts at rates well above site average in most published clickstream analysis, because someone arriving from a cited answer has already had their question handled. Put key events and pipeline next to sessions in every view you share. Then close the loop on the content side: the pages that show up in this report are the ones already earning citations, which tells you what to expand next. Our guides on how to get cited by ChatGPT and the LLMO content playbook cover what to do with that list, and if you want a model for what a citation first content operation looks like at scale, our breakdown of how Clay uses Clay for SEO and AEO is the closest public example.
See Where AI Assistants Already Mention You
GA4 tells you about the clicks you won. It cannot tell you about the answers where a competitor got named instead, and that gap is usually the bigger number. DevCommX runs a free AI Visibility Checker that shows how ChatGPT, Perplexity, Claude, and Gemini currently describe your category and who they cite, so you can see the mentions that never became sessions. It pairs directly with the exploration above: GA4 for the traffic you captured, visibility scanning for the demand you did not. We build the same measurement layer into the autonomous, signal based GTM systems our clients own outright, the ones that took teams from setup to 40+ qualified demos in roughly six weeks. Book a GTM strategy call to get your visibility scan and a look at what your AI referral data should be telling you.
Further Reading
- Google Analytics Help: Default channel group definitions, including AI Assistants
- Google Analytics Help: Create and manage custom channel groups
- Similarweb: Generative AI traffic and referral trend data
FAQ
Why does my ChatGPT traffic show as Direct in GA4?
Because the referrer header did not survive the click. Links opened inside the ChatGPT mobile apps launch in an embedded browser that drops the Referer header, and copy and paste does the same. If the link also lacks utm_source=chatgpt.com, GA4 has nothing to attribute with and files the session under Direct. Capturing document.referrer into a custom dimension via GTM is the reliable workaround.
Do I still need a custom channel group now that GA4 has an AI Assistants channel?
Yes. The native AI Assistants channel launched in May 2026 and applies forward only, so it does not reclassify your historical sessions. Google's published list also does not include Perplexity, which means those sessions stay in Referral. A custom channel group is applied at query time, so it works retroactively and lets you control exactly which platforms count.
What regex should I use for AI referral traffic in GA4?
Use a source based pattern such as (?i)^(chatgpt\.com|chat\.openai\.com|perplexity\.ai|claude\.ai|gemini\.google\.com|copilot\.microsoft\.com|grok\.com|chat\.deepseek\.com)$ on Session source, joined with an OR condition where Session medium exactly matches ai-assistant. Anchor the pattern, use the case insensitive flag, and always confirm the exact host strings in your own Traffic acquisition report first.
Does the AI Referrals channel need to sit above Referral in the priority order?
Yes, and this is the most common setup mistake. GA4 evaluates channel rules top down and assigns the session to the first channel that matches. Since AI hosts also satisfy the Referral definition, a correctly written AI Referrals channel placed below Referral will report zero sessions. Drag it above Referral, Organic Search, and Unassigned.
Can I separate Google AI Overviews traffic in GA4?
No. Google's documentation explicitly excludes AI Overviews and AI Mode from the AI Assistants channel, and clicks from those surfaces arrive as google / organic exactly like a standard search click. There is no referrer signal that separates them. Use Search Console impression and click patterns plus third party rank tracking to estimate that exposure instead.
How many custom channel groups can a GA4 property have?
Standard GA4 properties allow two custom channel groups with up to 25 channels in each. Analytics 360 properties allow five groups with the same 25 channel limit. Also set Admin, Data settings, Data retention to 14 months, because explorations only look back as far as that setting and the default is 2 months.
Planning your next GTM move? Get a quick audit of your sales, outbound, and RevOps systems.
Book Your Free GTM Audit
Replace manual prospecting with intelligent automation.
Let your sales team focus on closing.


















.webp)



























































.webp)
.webp)
.webp)
.webp)
.webp)
.webp)
.webp)
.webp)
.webp)
.webp)
.webp)
.webp)
.webp)
.webp)
.webp)
.webp)
.webp)
.webp)
.webp)

.webp)