GA4 AI Traffic Regex Generator
The GA4 AI Traffic Regex Generator is a free browser tool that builds a regular expression for the sources AI assistants send to Google Analytics 4. Paste it into a custom channel group and your AI traffic gets a channel of its own instead of sitting inside Referral.
It sits with the rest of our free tools at Free AI Search Tools.
How to use it
- Choose the AI assistants to include. Each one adds the domains it sends visits from, such as chatgpt.com or perplexity.ai, and their subdomains.
- Optionally turn on Also match utm_source names to catch links you tag yourself, such as utm_source=chatgpt.
- Copy the regex. You can test any session source in the box below it before you use it.
Add it to Google Analytics 4
- In Google Analytics 4, open Admin, then Data display > Channel groups.
- Select Create new channel group and give it a name.
- Select Add new channel, name it AI assistants, set the condition Source matches regex and paste your regex.
- Use Reorder to move AI assistants above Referral, because GA4 assigns each session to the first channel that matches.
- Save the group, then pick it in your Acquisition reports.
A custom channel group also applies to data collected before you created it.
What the regex cannot see
- Google AI Overviews and AI Mode: clicks from them arrive as google / organic, the same as regular search results, so no source regex can separate them.
- Visits without a referrer: some AI apps and in-app browsers send no referrer, so GA4 counts those visits as Direct. Treat the AI traffic you see as a minimum.
To see AI sessions, conversions and revenue by assistant without maintaining a regex, connect Google Analytics 4 or another analytics tool in AI Traffic.
Privacy
The regex is built in your browser. Nothing you type is sent to us.