Free tools › GA4 AI traffic regex generator (ChatGPT, Perplexity, Gemini, Claude)
GA4 AI traffic regex generator (ChatGPT, Perplexity, Gemini, Claude)
The question: How do I see visits from ChatGPT and other AI assistants in GA4?
GA4 lumps ChatGPT, Perplexity, Gemini and Claude visits in with every other referral. Google's own help suggests a custom channel group with a regex. Tick the assistants you want, copy the pattern, and test it against real source values from your reports before you save it.
2. Your regex
3. Test it
Paste session source values (one per line) from Reports › Acquisition › Traffic acquisition, with Session source as the dimension.
How to set it up in GA4
- Go to Admin › Data display › Channel groups. You need Editor access or above.
- Click Create new channel group. It starts as a copy of the default group.
- Click Add new channel, name it AI assistants, add a condition on Source, choose matches regex and paste the pattern above. Save the channel.
- Click Reorder and drag AI assistants above Referral. Traffic goes into the first channel it matches, so below Referral it would never be counted.
- Save the group, then open Acquisition › Traffic acquisition and pick your new group as the dimension.
Good to know
- Why the
.*at each end: Google says GA4 regex is a full match by default, so a pattern without.*only matches the exact value. The wrappers letwww.perplexity.aimatch as well asperplexity.ai. - Dots are escaped (
\.), sochatgpt\.comcan't match something likechatgptXcom. Google's own example uses broad words such asgptandcopilot, which can catch sources you didn't mean. Exact domains are narrower. - Never add plain
google: that's ordinary Google search traffic, not Gemini. - ChatGPT tags its links. OpenAI says ChatGPT adds
utm_source=chatgpt.comto referral URLs, which is whychatgpt.comshows up as the source. - It's a minimum. Visits from apps that pass no referrer or tag land in Direct, and this can't catch them.
- Limits: a standard GA4 property can have 2 custom channel groups (on top of the default), with up to 50 channels each. Google says custom channel groups apply to your reports retroactively.
Sources
- Google Analytics Help: Custom channel groups
- Google Analytics Help: About regular expressions
- OpenAI Help: Publishers and developers FAQ (utm_source=chatgpt.com)
Want the full workflow?
This tool answers one question. The matching workflow goes further, with a copy-ready AI prompt and step-by-step checks: Track ChatGPT and AI assistant visits in GA4 and Shopify
More free tools
EU product identifier checker for Shopify (GTIN, S-PID, NS-PID)
What do I need to add to this product so my EU parcels aren't held from 1 November 2026?
Answer five questions and get the exact identifier to add (GTIN, or the Y081 declaration), plus a bulk GTIN check-digit validator.
Merchant Center misrepresentation suspension: ready to request a review?
My Google Merchant Center account is suspended for misrepresentation. Can it be fixed, and am I ready to ask for a review?
Tick off Google's own misrepresentation checklist, see what's still missing, and find out whether you're ready to use your review request.
Shopify Catalog eligibility checker: why isn't my product included?
Why isn't my store or product in Shopify Catalog (the source for Shop and AI agents)?
Look up your admin's ineligibility message, check the store and product requirements, and scan a product for categories Shopify excludes.
AI Shopping Readiness Checker
Check a Shopify store's public product data and get a what-to-fix-first list.