Setting Up GA4 to Capture AI Search Referrals: The Complete Tracking Guide
GA4 out of the box misses most AI-referred traffic. This is the complete configuration guide — channel groupings, referral exclusions, UTM conventions, and custom dimensions.
By Marco De Luca, Fintech & Payments · May 25, 2026
Complete GA4 setup guide for tracking AI search referrals from ChatGPT, Perplexity, and Claude — channel groupings, UTM conventions, custom dimensions, BigQuery export.
Frequently Asked Questions
How do you set up GA4 to track traffic from ChatGPT and Perplexity?
To track ChatGPT and Perplexity referrals in GA4, you need to make three targeted configuration changes. First, create a custom channel grouping in Admin > Data Settings > Channel Groups that includes a new 'AI Search' channel. Set the condition to match referral sources containing 'perplexity.ai', 'chat.openai.com', 'chatgpt.com', 'claude.ai', 'gemini.google.com', 'copilot.microsoft.com', and 'you.com'. Second, remove these domains from your referral exclusion list — GA4 often auto-adds them, which converts the referral into direct traffic. Third, create a custom dimension called 'AI Referrer Source' mapped to the page_referrer event parameter, so you can segment AI traffic by specific assistant. Without these three changes, most ChatGPT and Perplexity sessions appear in GA4 as direct traffic with no source, making it impossible to evaluate the impact of your AEO investments on site behavior and conversions.
What channel grouping settings should be configured in GA4 for AEO tracking?
For AEO tracking in GA4, configure a custom channel group with an 'AI Search' channel defined by referral source conditions matching the major AI assistant domains: perplexity.ai, chat.openai.com, chatgpt.com, claude.ai, gemini.google.com, copilot.microsoft.com, you.com, and phind.com. Place this channel definition above the Organic Search and Direct entries in the priority stack so that GA4 evaluates it first. You should also configure a second 'AI-Assisted Branded Search' channel that captures sessions where the source is google.com or bing.com, the medium is organic, and the landing page contains your brand name — these sessions are often AI dark funnel conversions where a user discovered you via AI and then executed a branded search. Together, these two channel definitions give you the clearest available picture of AI-influenced traffic within GA4's standard reporting interface.
Why does GA4 show Perplexity and ChatGPT referrals as direct traffic?
GA4 misclassifies AI assistant referrals as direct traffic for three compounding reasons. First, many AI assistants use HTTPS-to-HTTPS link behavior where the Referrer header is stripped by default browser security policy, so the session arrives with no referrer information at all. Second, GA4's default referral exclusion list has historically included social and search domains broadly, and some deployments have auto-excluded AI assistant domains, converting their referrals to direct. Third, ChatGPT's web interface often opens links in a new tab or via an intermediate redirect, which can reset the referrer chain. The Perplexity.ai domain passes referrer information more reliably when users click direct links in answers, but only when the link is not opened via a JavaScript redirect. You can verify the scope of the problem by running a BigQuery export query on your raw event data and looking at the page_referrer parameter — you will often find perplexity.ai or claude.ai in raw referrers that GA4 has credited to the Direct channel.
What UTM parameters should be added to AEO-sourced campaigns?
For content that is designed to be cited by AI assistants and then linked to users, establish a UTM convention that captures AI-assisted discovery even when users navigate to your site from secondary touchpoints. Use utm_source=ai-search as the baseline for any campaign explicitly targeting AI citation. For platform-specific tracking, use utm_medium values of chatgpt, perplexity, claude, or gemini when you are placing content in channels where a specific assistant is the primary discovery vector. Use utm_campaign to tag the content cluster or AEO initiative — for example, utm_campaign=comparison-pages-q2-2026 or utm_campaign=schema-refresh. The most important UTM application for AEO is on press releases, syndicated content, and guest posts — places where your content will be discovered by AI crawlers and cited in answers that then drive clicks. Tagging these distributions at the source gives you a clean signal in GA4 that distinguishes AI-citation-influenced traffic from organic traffic.
How do you use BigQuery with GA4 to analyze AI search traffic in depth?
Connecting GA4 to BigQuery via the native export (Admin > BigQuery Linking) gives you access to the raw event stream, including the page_referrer parameter that GA4's channel attribution model often discards. Once data is flowing, run a query against the events table filtering for event_name = 'session_start' and extract collected_traffic_source.manual_source or the page_referrer parameter. Use a regex filter — WHERE page_referrer LIKE '%perplexity%' OR page_referrer LIKE '%chatgpt%' OR page_referrer LIKE '%claude.ai%' — to isolate AI-referred sessions. Join this table to the conversion event table on session_id to calculate AI-assisted conversion rates. The most powerful BigQuery analysis for AEO teams is a time-series query that compares weekly AI referral session volume against weekly branded search session volume — when these two metrics move together, it is strong evidence that your AI citation improvements are driving dark funnel pipeline. Export this to Looker Studio for the CMO dashboard.
Related Articles
Topics: AEO, GA4, Analytics, Attribution, Tracking, Technical
Browse all articles | About Signal