GA4 AI Traffic Tracking: Setup Guide for AI-Referral Analytics
Google Analytics 4 does not natively classify traffic from AI platforms like ChatGPT, Claude, or Perplexity. By default, AI-referred traffic lands in the Direct or Unassigned channel, obscuring one of the fastest-growing acquisition sources on the web. This guide walks you through the complete GA4 setup — custom channel groups, Exploration reports, UTM conventions, and optional GTM automation — so you can see exactly how much AI-driven traffic reaches your site, which platforms send the most valuable visitors, and how those visitors behave downstream.
Why Track AI Traffic in GA4?
GA4's default channel group assigns AI-referred traffic to Direct or Unassigned because it has no built-in rules for platforms like chatgpt.com or perplexity.ai. Without custom configuration, you cannot answer basic questions: Is my AI visibility translating to click-through traffic? Which AI platform sends the most engaged users? Are AI-referred visitors converting?
These questions matter because AI referral is structurally different from traditional search. A user arriving from Perplexity is typically further along in their research journey — Perplexity citations imply the AI found your content authoritative. That user may be worth more than an organic search visitor, but you will never know if GA4 classifies them as Direct.
Creating a Custom Channel Group for AI Traffic
GA4's channel group system evaluates traffic rules top-down. The first matching rule wins, so order matters. Create one channel per AI platform, then add a combined AI Search channel as a fallback.
Channel Definitions
For each AI platform, create a channel with two conditions:
Condition 1: Source matches the platform's regex pattern. Condition 2: Medium exactly matches referral.
The source regex patterns are:
- ChatGPT: chatgpt.com|chat.openai.com
- Claude: claude.ai|anthropic.com
- Gemini: gemini.google.com|bard.google.com
- Perplexity: perplexity.ai
- Grok: grok.x.ai
- Microsoft Copilot: copilot.microsoft.com
- You.com: you.com
- Phind: phind.com
- Kagi: kagi.com
After creating individual channels, add a combined AI Search channel with a single source regex that matches all platforms combined. Place individual channels above the combined channel in the list so specific matches take priority.
Common Setup Mistakes
The most frequent error is omitting the Medium condition. Without it, paid or organic traffic from an AI platform domain would also match, contaminating your channel data. Always include Medium = referral alongside the Source regex.
The second common mistake is placing the combined channel above specific channels. GA4 applies the first matching rule, so broad combined channels must come after specific ones.
Building AI Traffic Exploration Reports
GA4 Explorations give you flexible analysis beyond the standard Reports. Build three core explorations for AI traffic intelligence.
Traffic Overview Exploration
Create a free-form exploration with Session source/medium as rows and Sessions, Total users, Engaged sessions, Engagement rate, and Conversions as values. Apply a filter where Source matches the combined AI platform regex. This gives you a sortable table of all AI sources and their core metrics in one view.
Conversion Path Exploration
Add a free-form exploration that shows conversion paths starting from AI channels. Use Session default channel group as the row dimension and set the start node to your AI Search channel. This reveals whether AI visitors convert directly, return later, or flow through other channels first.
User Cohort Exploration
Build a cohort exploration segmented by AI platform to compare retention and repeat behavior across platforms. A Perplexity visitor cohort may show higher repeat rates than a ChatGPT cohort, informing where to focus AI visibility investment.
UTM Parameters for AI Placements
When you proactively distribute content on platforms that AI models crawl — forums, Q&A sites, community platforms — use dedicated UTM parameters to track click-through attribution. This is distinct from AI citation attribution, which GA4 captures via referral data.
Recommended UTM structure for AI placements:
- utm_source: the platform name (reddit, stackoverflow, hacker-news)
- utm_medium: ai-placement
- utm_campaign: your GEO campaign identifier
This convention distinguishes actively distributed content from organic AI referrals and lets you filter AI placement campaigns in GA4 separately from direct referral attribution.
GA4 cannot automatically detect when your content is cited by an AI without a user clicking through. For citation-level attribution, you need a platform like Citerna that directly queries AI models to determine whether your brand appears in responses.
Google Tag Manager Automation
For teams that need session-level AI platform dimensioning beyond what GA4 channel groups provide, GTM enables custom event tracking with an AI platform dimension.
Create a Custom JavaScript variable in GTM that reads document.referrer and tests it against the AI platform regex patterns. Fire a GA4 event named ai_referral_detected with an ai_platform parameter containing the matched platform name. Then register ai_platform as a custom session-scoped dimension in GA4 Admin under Custom definitions.
With this setup, ai_platform appears as a breakdown dimension in any GA4 report, enabling analysis like "What is the conversion rate by AI platform for all my sessions?"
Expected AI Traffic Characteristics
After four to eight weeks of data collection, AI traffic typically shows distinct behavioral patterns worth knowing when you set benchmarks.
AI-referred sessions generally show higher-than-average engagement rates and more pages per session, reflecting research behavior. However, conversion rates are often lower in volume but higher in intent — users referred by AI are evaluating options rather than ready to purchase. Average order value or revenue per session frequently exceeds the site average, particularly for B2B SaaS and high-consideration purchases.
Understanding these patterns helps set realistic expectations. AI visibility investment may not show up as conversion volume immediately, but the brand awareness and consideration effects compound over time.
Combining GA4 Data with Citerna
GA4 shows you what happens after users arrive from AI platforms. Citerna shows you whether AI models mention your brand before the click ever happens. Together they form a complete attribution picture.
GA4 answers: Which AI platforms send me traffic, and what do they do on my site? Citerna answers: Which AI models mention my brand for relevant queries, which competitors are mentioned instead, and what content triggers those mentions?
Use Citerna's prompt-level data to identify high-value prompts where your competitors are cited but you are not. Then create targeted content for those prompts. Measure the resulting mention improvements in Citerna, and watch for corresponding traffic increases in your AI referral channel in GA4.
Frequently Asked Questions
Why doesn't GA4 track AI traffic automatically?
GA4's default channel group has no rules for AI platforms like chatgpt.com or perplexity.ai. AI referrals arrive as Direct or Unassigned traffic unless you create custom channel group rules.
What is the difference between AI referral tracking and AI citation tracking?
AI referral tracking (GA4) measures users who click through from an AI interface to your site. AI citation tracking (Citerna) measures whether AI models mention your brand in their responses, which may or may not involve a click. Many AI mentions happen without any referral traffic.
Can I track AI traffic without GTM?
Yes. Custom channel groups in GA4 Admin handle most tracking needs without GTM. GTM is only needed if you want a dedicated session-level AI platform dimension available as a breakdown in all reports.
How long before I see meaningful AI traffic data in GA4?
Expect 4-8 weeks to accumulate enough data for meaningful analysis. AI traffic volume depends on your AI visibility score and industry. B2B SaaS and technical content typically see AI referrals faster than consumer brands.
What UTM parameters should I use for AI placement campaigns?
Use utm_medium=ai-placement to distinguish actively distributed content from organic AI referrals. Combine with utm_source for the platform (reddit, stackoverflow) and utm_campaign for your specific campaign identifier.
See which AI models mention your brand
Start Free Trial