The GA4 AI Referral Regex Generator builds a regular expression that matches the source domains of AI assistants such as chatgpt.com, perplexity.ai, claude.ai and gemini.google.com. Paste it into a GA4 custom channel group or an Explore filter to group AI traffic.
Key takeaways
- Build the regex that groups AI assistant traffic in Google Analytics 4.
- Runs entirely in your browser. Nothing you enter is uploaded.
- Free to use with no sign-up and no API key.
- Watch out: Placing the channel below Referral.
What does the GA4 AI Referral Regex Generator do?
Use it to separate AI referrals from general referral traffic. Expect undercounting, because some AI apps send no referrer and show up as Direct.
How do you use the GA4 AI Referral Regex Generator?
- Tick the AI sources you want.
- Add any extra domains.
- Generate and copy the regex.
- Create a custom channel in GA4 and place it above Referral.
How do you read the results?
The regex matches any source that contains one of the domains. Dots are escaped so they match literally.
Review the list every few months because AI products change domains.
What mistakes should you avoid?
- Placing the channel below Referral.
- Forgetting new AI domains.
- Assuming all AI traffic is captured.
Frequently asked questions
Where do I paste the regex?
In GA4 Admin, open Channel groups, create a channel and set Source matches regex.
Why is some AI traffic Direct?
Apps and browsers may not pass a referrer.
Does this work in Looker Studio?
Yes, similar regex conditions can be used in filters.