Technical

How to Track AI Referral Traffic in GA4: ChatGPT, Perplexity, Gemini, and Claude

Tracking AI referral traffic in GA4 means correctly attributing sessions that arrive from ChatGPT, Perplexity, Gemini, Claude, and Copilot instead of letting them scatter across Referral, Direct, and Organic Search. GA4 shipped a native AI Assistant channel in May 2026, but it misses Perplexity and every session that arrives with a stripped referrer. Here is the custom channel group and Explore workflow that catches what the default setup does not.

Neil Walsh·August 2026·8 min read

To track AI referral traffic in GA4, you need to identify sessions where the referrer domain matches a known AI assistant, such as chatgpt.com, perplexity.ai, claude.ai, gemini.google.com, or copilot.microsoft.com, and group them into their own channel instead of letting GA4's default rules file them under Referral, Direct, or Organic Search. GA4 added a native AI Assistant channel in May 2026 that does some of this automatically, but it has two significant gaps: it excludes Perplexity entirely, and it cannot see any session that arrives without a referrer at all, which is common when a link is opened from inside an AI app's in-app browser.

For a site built around getting cited by AI answer engines, this matters more than it would for an ordinary marketing site. If your GA4 reports quietly fold ChatGPT and Perplexity sessions into Direct traffic, you cannot demonstrate that a citation drove a real visit, cannot compare AI-referred engagement against organic search, and cannot show which landing pages are actually converting AI mentions into pipeline. Fixing the attribution takes about fifteen minutes.

Why GA4's default channel grouping misses most AI traffic

GA4's default channel grouping was built before AI answer engines existed as a meaningful traffic source, and it still reflects that. A session with a referrer of chatgpt.com and no UTM parameters is classified as Referral, sitting in the same bucket as a random blog linking to you. A session that arrives with no referrer header at all, which happens whenever a user copies a link out of a chat response or opens one from a native mobile app, is classified as Direct, indistinguishable from someone typing your URL from memory. Both outcomes erase the fact that an AI answer is what actually sent the visitor.

A referrer-less AI session is not a bug you can fix with better tracking. Many AI apps strip the referrer for privacy reasons before the click ever reaches your site, so no amount of GA4 configuration will recover it. Treat every number in this guide as a floor on true AI-driven traffic, not a ceiling.

The quick method: GA4's native AI Assistant channel

As of the May 2026 update, GA4 ships a built-in AI Assistant channel that automatically catches sessions referred from ChatGPT, Gemini, and Claude when a referrer is present. To check whether it is already picking up your traffic, open Reports > Acquisition > Traffic acquisition and look for AI Assistant in the Session default channel group list. If you see it with sessions attached, the native rule is working for at least part of your AI traffic.

The native channel has two blind spots worth knowing before you rely on it. First, it does not include Perplexity, which is one of the highest-intent AI referral sources for most B2B and technical content sites. Second, like every channel rule, it depends on a referrer header being present, so it inherits the same undercount problem as the rest of GA4 for in-app and copy-paste traffic. Both gaps are reasons to build a custom channel group rather than stop at the default.

Building a custom channel group that catches everything

A custom channel group lets you define your own matching rule and place it ahead of GA4's built-in rules, so traffic that would otherwise fall into Referral or the incomplete AI Assistant bucket gets classified correctly first.

  1. In GA4, go to Admin > Data display > Channel groups
  2. Select Create new channel group and name it something identifiable, such as "AI Referral Sources"
  3. Add a new channel rule and set the condition to Session source contains, then enter a regex matching the assistants you care about: chatgpt\.com|chat\.openai\.com|perplexity\.ai|claude\.ai|gemini\.google\.com|bard\.google\.com|copilot\.microsoft\.com|meta\.ai
  4. Name the matched channel "AI Assistants" so it reads clearly in reports
  5. Drag your new AI Assistants rule to the top of the rule list, above the default Referral rule
  6. Save the channel group, then apply it as a comparison or secondary dimension on your Traffic acquisition report

Rule order is the part people get wrong. If the default Referral rule evaluates first, Perplexity and ChatGPT sessions match it before they ever reach your AI Assistants rule, and your new channel stays empty. Always drag the custom rule above the built-in Referral and Organic Search rules.

Backfilling and inspecting historical AI traffic

A new channel group only reclassifies data going forward from a small lookback window, so it will not retroactively relabel months of past sessions. To see how much AI traffic you were already getting before you built the channel group, use an Explore report instead of the standard channel view.

  • Go to Explore > Free-form and start a blank exploration
  • Add Session source / medium as a dimension and Sessions, Engaged sessions, and Average engagement time as metrics
  • Apply a dimension filter using the regex from the channel rule above to isolate matching rows
  • Sort by Sessions descending to see which assistant is sending the most traffic historically
  • Add Landing page as a secondary dimension to see which pages each assistant is actually sending visitors to

This Explore view is also the fastest way to sanity-check a new channel group before you trust it in a dashboard. If the regex is wrong, sessions you expect to see from perplexity.ai or chatgpt.com simply will not appear in the filtered table, which is much easier to spot in a free-form report than in an aggregated channel chart.

What to do once AI referral traffic is visible

Isolating the channel is the setup step, not the goal. Once AI referral sessions are broken out cleanly, three comparisons become possible that were not before. Compare engaged session rate for AI Assistants against Organic Search on the same landing pages, since AI-referred visitors typically arrive with a specific question already answered and often show different engagement patterns than someone still evaluating options from a search results page. Compare which landing pages receive AI referral sessions against which pages Google Search Console shows appearing in AI Overviews, since a page can show impressions in one surface and clicks in the other without the two lining up. And track the trend over time per assistant, since a rising ChatGPT channel and a flat Perplexity channel calls for a different content response than the reverse.

Feed what you learn back into your measurement stack rather than treating it as a one-off report. If you are already running the broader AEO metrics programme this site recommends, the GA4 AI Assistants channel becomes one more input alongside citation frequency and share of voice, and it is the one input that ties an AI citation directly to a session, a landing page, and downstream conversion behaviour.

Common pitfalls that undercount AI traffic further

Even a correctly built channel group leaves real gaps, and knowing them prevents you from over-trusting the final number.

  • Dark traffic from copy-paste behaviour: a user who reads an answer in ChatGPT and then manually types your URL, or copies a link into a new tab, generates a Direct session GA4 cannot connect to the AI answer that caused it
  • In-app browser stripping: opening a link from inside the ChatGPT or Perplexity mobile app can drop the referrer entirely, depending on the app version and platform, again landing the session in Direct
  • Self-referral pollution: if your own domain is not in GA4's referral exclusion list, cross-subdomain navigation can occasionally be misattributed as a Referral session, diluting the signal in the channel you are trying to isolate
  • New assistants and rebrands: the regex above covers the assistants with meaningful traffic today, but AI search products launch and rename often enough that the rule needs a periodic review, not a one-time setup

Do not present the AI Assistants channel total as your complete AI-driven traffic figure in a board deck without the dark-traffic caveat attached. Because so many AI-influenced visits arrive with no referrer, the true number is meaningfully higher than what any GA4 channel group can show, and overstating precision here undermines trust in the rest of the report.

GA4 alongside Search Console, not instead of it

GA4's AI Assistants channel tells you who actually clicked through to your site. It has no visibility into citations where an AI engine answered a question using your content without sending a click at all, which is the majority outcome for most AEO efforts. Search Console's AI Overviews reporting and a direct AI citation gap analysis against competitors cover that half of the picture. Use GA4 to measure what happens after someone clicks, and the other two to measure whether you are being cited in the first place.

Frequently asked questions

Does GA4 automatically track ChatGPT and Claude traffic?

Partially. Since the May 2026 update, GA4 includes a native AI Assistant channel that automatically classifies sessions referred from ChatGPT, Gemini, and Claude when a referrer header is present. It does not include Perplexity, and it cannot capture sessions where the referrer was stripped before reaching your site, so a custom channel group and periodic Explore checks are still necessary for complete coverage.

Why is my AI referral traffic showing up as Direct in GA4?

This happens when the AI application strips the referrer header before the user clicks through, which is common in mobile in-app browsers and when a user copies a link out of a chat response rather than clicking it directly. GA4 has no way to reconstruct a missing referrer, so these sessions default to the Direct channel regardless of channel group configuration.

What is GA4's AI Assistant channel and when was it added?

GA4's AI Assistant channel is a native, built-in traffic channel that automatically groups sessions referred from major AI chat products, added to the platform in May 2026. It works the same way as GA4's existing Organic Search or Referral channels, using the session's referrer domain to classify it, but it currently excludes Perplexity.

How do I track Perplexity traffic specifically in GA4?

Because Perplexity is not covered by GA4's native AI Assistant channel, you need a custom channel group with a rule matching Session source contains perplexity.ai, placed above the default Referral rule in the rule order. Without the reordering step, Perplexity sessions continue to be classified as ordinary Referral traffic.

What regex should I use for an AI traffic channel group in GA4?

A regex covering the highest-volume assistants is chatgpt\.com|chat\.openai\.com|perplexity\.ai|claude\.ai|gemini\.google\.com|bard\.google\.com|copilot\.microsoft\.com|meta\.ai. Review and extend this list periodically, since new AI search products and domain changes are common enough that a rule built once will drift out of date within a year.

Can I see AI referral traffic from before I set up the custom channel group?

Channel groups in GA4 apply going forward and to a limited backfill window, not to your full historical data. To inspect AI referral sessions from further back, use an Explore free-form report with Session source / medium as a dimension and a filter matching your AI domain regex, rather than relying on the standard channel acquisition report.

Does GA4 AI referral tracking replace Search Console for measuring AI visibility?

No, the two measure different halves of the funnel. GA4's AI Assistants channel shows sessions where someone actually clicked through from an AI answer to your site. Search Console's AI Overviews data and a direct citation gap analysis show whether AI engines are citing you at all, including the far more common case where a user gets an answer without clicking through anywhere.

Why does my AI referral number still feel too low compared to what I see anecdotally?

Because referrer-based tracking structurally undercounts AI-driven traffic. A large share of AI-influenced visits arrive as Direct sessions after a user copies a link, remembers a brand name, or opens a result from an in-app browser that strips the referrer. Treat any GA4 AI channel figure as a conservative floor rather than a complete count of AI influence on your traffic.

Free tool

See your AEO score in seconds

Paste your URL and get a full audit across all 9 AEO signals - schema, crawlers, E-E-A-T, and more.

Audit my site - it's free

Related reading

Technical

Why Schema.org markup is the single biggest lever for AI citation

May 2026
Technical

Is your robots.txt accidentally blocking ChatGPT and Claude?

May 2026