GA4 AI Referrer Tracking

Configuring Google Analytics 4 to capture, segment, and report on traffic sourced from AI engines like ChatGPT, Perplexity, and Gemini.

Updated 2026-04-17 · AEO glossary

Definition

GA4 AI referrer tracking requires creating a custom channel group called 'AI Search' that matches source domains for major AI engines (chatgpt.com, perplexity.ai, gemini.google.com, claude.ai, copilot.microsoft.com, you.com, phind.com). Without explicit configuration, GA4 typically classifies AI sessions as 'direct' or 'referral' without distinguishing them from other traffic. Setting up the custom channel group takes 10–15 minutes and is foundational for any AEO measurement effort.

Why it matters

GA4's default channel grouping was designed before AI engines became major traffic sources. Without manual configuration, AI-driven traffic gets buried in 'direct' or 'unassigned' segments, making it impossible to measure AEO impact. The custom channel group is the prerequisite for everything else.

Example

Setup steps in GA4: Admin → Data display → Channel groups → Create new → Add rule 'Source contains chatgpt.com OR perplexity.ai OR gemini.google.com OR claude.ai OR copilot.microsoft.com' → Name it 'AI Search.' Now you can filter all reports by this channel and measure AI-driven sessions, conversions, and revenue independently.

FAQ

Common questions about ga4 ai referrer tracking.

Why do most AI sessions show as 'direct' in GA4?
Three reasons: (1) AI engines often strip the referrer header at the HTTPS handshake, (2) users frequently open URLs from AI answers in new tabs (which can lose referrer), (3) AI engines accessed via embedded interfaces (Cursor, ChatGPT desktop) don't pass referrers at all. The custom channel group catches the cleanly-attributed sessions; expect 30–60% of true AI traffic to still appear as 'direct.'
Can I attribute pipeline directly from GA4 AI Search channel?
Partially. GA4 attributes sessions and conversions, but not contacts to opportunities to closed-won. For full pipeline attribution, you need a tool like Lantern that joins GA4 session data with HubSpot or Salesforce CRM data.

Lantern measures this in production.

The terms in this glossary aren't theoretical — they're what Lantern's product calculates and reports every month for B2B SaaS teams. See yours in 7 days. 14-day free trial.

Join Waitlist