Key point. Paste referrer URLs, hostnames or GA4 source / medium pairs, one per line, and see which ones the AI-traffic pattern counts as AI referrals. The pattern is the one we use in our own reporting, and you can copy it into a GA4 channel group. It runs in your browser.
- Home
- Free tools
- GA4 AI traffic regex tester
GA4 AI traffic regex tester
Test which visits GA4 would count as AI traffic
Paste referrer URLs, hostnames, GA4 "source / medium" pairs or landing URLs with utm tags, one per line. Each line is tested against the AI-source pattern we use in our own reporting. Nothing leaves your browser.
| Line | Source | Verdict | Matched |
|---|
How do I use the pattern in GA4?
Use it in a custom channel group so AI referrals get their own row in your reports. In GA4, open Admin, then Data display, then Channel groups, copy the default group, add a channel named "AI assistants" whose condition is Source matches the pattern above, and move that channel above Referral so it is checked first. Google's help pages on custom channel groups describe each screen. The pattern is wrapped as .*( ... ).*, so it gives the same answer whether a GA4 screen compares the whole source or only a part of it.
What does the tester count, and what does it miss?
It counts a visit as an AI referral when its source names an AI assistant or AI search product (ChatGPT, Perplexity, Gemini, Copilot, Claude and others in the pattern). It counts a visit with a paid medium (cpc, ppc, paid, display) as paid, even from an AI source, because a click on an ad is not a referral. It misses visits that arrive with no referrer at all: several assistants' apps open links that way, and GA4 then reports them as direct. No pattern can recover those.
Why test a pattern before using it?
Because a loose pattern counts the wrong sites and a narrow one misses new assistants. Running your own last 90 days of sources through the tester shows both: a source the pattern catches that is not an assistant, and an assistant your sources show that the pattern does not catch yet.
Worked example: ten sources from a GA4 export
For example, the AI referrer regex tester reads these ten lines from a GA4 export. They mix referrer URLs, a hostname, source / medium pairs and a landing URL with a utm tag.
https://chatgpt.com/
perplexity.ai / referral
https://www.example.com/pricing?utm_source=chatgpt.com
gemini.google.com / referral
copilot.microsoft.com
claude.ai / referral
chatgpt.com / cpc
google / organic
news.ycombinator.com / referral
(direct) / (none)The tester counts 6 of the 10 lines as AI referrals, one as paid and three as other:
| Line | Source it reads | Verdict | Why |
|---|---|---|---|
| https://chatgpt.com/ | chatgpt.com | AI referral | matches chatgpt |
| perplexity.ai / referral | perplexity.ai | AI referral | matches perplexity |
| ...?utm_source=chatgpt.com | chatgpt.com | AI referral | the utm_source tag ChatGPT adds |
| gemini.google.com / referral | gemini.google.com | AI referral | matches gemini |
| copilot.microsoft.com | copilot.microsoft.com | AI referral | matches copilot |
| claude.ai / referral | claude.ai | AI referral | matches claude |
| chatgpt.com / cpc | chatgpt.com | paid | an ad click, not a referral |
| google / organic | other | a search engine, not an assistant | |
| news.ycombinator.com / referral | news.ycombinator.com | other | not an AI source |
| (direct) / (none) | (direct) | other | no referrer at all: an assistant's app may hide here, and no pattern can recover it |
Built by Elementera. The pattern is the same one Elementera reports with every week. It was last changed on October 22, 2026, when NotebookLM and Vertex AI Search were added. Last checked on November 3, 2026, with the ten lines above.
FAQ
Is anything I paste sent to Elementera?
No. The tester runs in your browser and nothing is uploaded.
Does this connect to my GA4 property?
No. Export your session sources from GA4 (or copy them from a report) and paste them in. The tester never reads your account.
Why is ChatGPT traffic sometimes tagged utm_source=chatgpt.com?
ChatGPT adds that tag to some links it shows, so the visit carries the source even when the browser sends no referrer. The tester reads utm_source from a pasted URL for that reason.
Work with us
Want to see whether ChatGPT and Gemini name your company for your buyers' questions? Get your free AI visibility report from Lenz. Want the measurement set up for you? Book a call about managed AEO services.
