AI Referral Regex Generator
Create a source regex for a GA4 custom channel group or Exploration. Pick the AI assistants you want to monitor, then copy the expression. Everything runs in your browser.
Enter domains only, separated by commas. The tool safely escapes dots and other regex characters.
Your GA4 source regex
GA4 setup
- Open Admin → Data display → Channel groups and create a custom channel group.
- Add an AI referrals channel before Referral and Direct.
- Set Session source to “matches regex” and paste the expression above.
- Apply it to a report or Exploration; validate against actual landing-page sessions before treating it as complete attribution.
Important: a regex only captures visits that retain a referrer. AI answers can be zero-click and some clicks lose referrer data, so use this alongside Search Console and server logs—not as a citation count.
Related: How to track AI search traffic in GA4 · What Google’s AI report measures · More free tools
The domains behind each checkbox
Each option maps to the referrer domain the assistant actually emits today, not the company homepage. Two details are easy to miss: ChatGPT traffic can still arrive from the legacy chat.openai.com domain on older surfaces (add it under Additional domains if you see it in reports), and Gemini emits gemini.google.com, which the regex matches exactly so that ordinary google.com search traffic is not swallowed into the AI channel.
| Checkbox | Referrer domain | Worth knowing |
|---|---|---|
| ChatGPT | chatgpt.com | Legacy chat.openai.com still appears; add it manually |
| Perplexity | perplexity.ai | Some clicks arrive via pplx.ai short links |
| Claude | claude.ai | Referrer often stripped by in-app browsing |
| Gemini | gemini.google.com | Do not widen to google.com; that is Search |
| Microsoft Copilot | copilot.microsoft.com | Copilot in Bing lands as bing.com instead |
| You.com / Phind / DeepSeek | you.com, phind.com, deepseek.com | Small today; cheap to include |
Maintenance: the list rots quietly
AI referrer domains change more often than search ones. OpenAI moved ChatGPT to a new domain, assistants add link-wrapping hosts, and new engines appear every quarter. A channel group built once and never revisited will silently undercount. A simple routine keeps it honest: once a quarter, pull your top referral sources for the period and run them through the AI referral traffic checker, which flags AI domains in a pasted list. Anything it tags that your regex misses goes into the Additional domains box here, and the updated expression replaces the old one in GA4. The channel group definition itself takes effect from the day you change it; GA4 does not reprocess history, which is another reason not to wait a year between updates.
What to do with the channel once it exists
Treat the AI referrals channel as a trendline, not a census. Referrer-based counting misses zero-click answers and stripped referrers entirely, and part of real AI traffic hides inside Direct, a mechanic we unpack in how to track ChatGPT traffic. The number that matters is direction: share of sessions quarter over quarter, landing pages AI users actually hit, and whether those sessions engage. The full GA4 setup, including Explorations that segment by this channel, is in how to track AI search traffic in GA4.
Frequently asked questions
Why does my AI channel show zero sessions after setup?
Three usual causes: the channel group was created but not applied to the report you are viewing, the channel sits below Referral in the evaluation order so Referral claims the sessions first, or the site genuinely receives no AI referrals yet. Check order first; the AI channel must sit above Referral and Direct.
Should the regex use full match or partial match?
The generated expression is anchored (^ and $) for GA4’s “matches regex” condition, which is a full match. If you paste it into a tool that applies partial matching, the anchors still work correctly, so keep them.
Can I use this regex outside GA4?
Yes. The same expression works anywhere referrer hostnames are filterable: Looker Studio filters, BigQuery exports of GA4 data, Matomo segments, or a log-analysis script. Only the field name changes; the domain alternation is portable.
Does matching a referrer prove the assistant cited my site?
No, it proves a user clicked from the assistant to your site. Citations without clicks are invisible to analytics, and some clicks lose their referrer in transit. Referral data is the floor of your AI visibility, never the ceiling.


