Cherry Seed

What regex catches all AI referral traffic in GA4?

ga4-regex ai-referral custom-channel-group chatgpt perplexity

Quick Answer

The working regex for a GA4 custom channel group covering all major AI platforms is chatgpt\.com|chat\.openai\.com|perplexity\.ai|claude\.ai|gemini\.google\.com|copilot\.microsoft\.com|meta\.ai|chat\.mistral\.ai|deepseek\.com. GA4's built-in AI Assistant channel only detects 5 of 12+ known AI referrer domains (SubredditSignals, 2026), so the custom regex is essential. Create a custom channel group in GA4 Admin, add this regex as a source match, and position it above Referral in the priority order so it catches traffic before the default rules do.

Full Answer

GA4 shipped a native AI Assistant channel in 2025, but it only recognises a handful of domains — ChatGPT, Gemini, Perplexity, and a couple of others. That leaves Claude, Copilot, Meta AI, Mistral, and DeepSeek falling straight into the Referral or Direct buckets, where they're invisible to anyone reviewing channel performance. For stores running paid campaigns alongside organic, that blind spot distorts attribution across every report.

The fix is a custom channel group. In GA4 Admin, create a new channel definition with "source matches regex" set to the full pattern above, and drag it above Referral in the priority stack. ChatGPT also appends utm_source=chatgpt.com to outbound links, so adding a second condition for that UTM parameter catches visits even when the referrer header is stripped — which happens more often than most teams realise. New AI platforms appear regularly, so revisit the regex quarterly and add any domains you spot in your referral report that the pattern doesn't yet cover.

This matters because AI referral traffic converts differently from organic or paid. Visitors arriving from an AI platform have already read a recommendation; they're further down the intent curve. Lumping them into Direct means the channel driving those conversions gets zero credit — and budget decisions follow the data you can see, not the data hiding in the wrong bucket. A deeper breakdown of the regex approach walks through the full setup, the edge cases to watch for, and what happens when AI platforms change their referrer behaviour.

Sources

Programmatic Access

GET https://seresa.io/wp-json/cherry-tree-by-seresa/v1/seeds/1150

Cite This Answer

Cherry Tree by Seresa - https://seresa.io/seed/ai-data-readiness/what-regex-catches-all-ai-referral-traffic-ga4