GA4 AI Search & Chatbot Referral Traffic RE2 Regex Builder.
Generate an RE2-compliant Session Source regex to segment ChatGPT, Perplexity, Claude, Gemini & Copilot traffic in GA4 and Looker Studio.
14 referral domains matched in RE2
GA4 Session Source RE2 regex
^(?:.*\.)?(?:chatgpt\.com|chat\.openai\.com|openai\.com|perplexity\.ai|claude\.ai|anthropic\.com|gemini\.google\.com|bard\.google\.com|copilot\.microsoft\.com|edgeservices\.bing\.com|meta\.ai|grok\.com|you\.com|phind\.com)$SQL channel grouping snippet
CASE
WHEN REGEXP_CONTAINS(LOWER(traffic_source.source), r'^(?:.*\.)?(?:chatgpt\.com|chat\.openai\.com|openai\.com|perplexity\.ai|claude\.ai|anthropic\.com|gemini\.google\.com|bard\.google\.com|copilot\.microsoft\.com|edgeservices\.bing\.com|meta\.ai|grok\.com|you\.com|phind\.com)$') THEN 'AI Search & Assistants'
ELSE 'Other Channels'
END AS ai_channel_groupHow to use this in your SEO workflow
- GA4 buckets AI assistant referrals under generic Referral traffic unless you group them with a Session Source RE2 pattern.
- In GA4 Admin -> Data display -> Channel groups, add a custom channel where Session source partially/fully matches regex.
- Pair your top AI landing pages with the AI Overviews & GEO Readiness Checker to double down on citable page structures.
Related in-depth SEO guides
Strategy
Start with High-Impression Pages Sitting in Positions 4–12
Why pages hovering near the bottom of page one or top of page two deliver the fastest organic traffic gains—and how to prioritize them systematically.
Data readingTreat Shared Queries as Investigation Leads, Not Automatic Merges
How to distinguish harmful keyword cannibalization from healthy multi-URL SERP visibility before deleting or redirecting pages.