GA4 AI traffic regex builder
Tick the AI assistants you want to track. Copy a GA4 regex and the settings for an "AI assistants" channel, then test it on your own source and referrer values. It all runs in your browser.
2. Your regex
Source, matches regex
Paste it as the condition of a custom channel group. It also works as a Session source filter in explorations.
^((www\.)?(chatgpt\.com|perplexity\.ai|copilot\.com|grok\.com|meta\.ai)|chat\.openai\.com|claude\.ai|gemini\.google\.com|copilot\.cloud\.microsoft|copilot\.microsoft\.com|chat\.deepseek\.com|chat\.mistral\.ai)$
210 characters
3. Channel group settings
Google's steps for a custom channel group, in order.
- In GA4, open Admin. Under Data display, click Channel groups.
- Click Create new channel group. GA4 starts you from a copy of the default group. Give it a name, for example "Channels with AI assistants".
- Click Add new channel and name it "AI assistants".
- Click Add condition group. Pick Source, then matches regex, and paste the Source regex. Click Save channel.
- Click Reorder and drag "AI assistants" above Referral. If your copy has Google's own AI Assistant channel, drag yours above that too, or your list never gets the traffic it matches. Keep it below the paid channels, so ads tagged with an assistant as utm_source stay in paid. Click Apply.
- Click Save group. Then open Reports, Acquisition, Traffic acquisition and pick your group as the primary dimension.
4. Optional: filters in explorations and reports
Google says exploration filters are case sensitive. The regex is all lower case, so check that the values in your report are lower case too.
Session source, matches regex
^((www\.)?(chatgpt\.com|perplexity\.ai|copilot\.com|grok\.com|meta\.ai)|chat\.openai\.com|claude\.ai|gemini\.google\.com|copilot\.cloud\.microsoft|copilot\.microsoft\.com|chat\.deepseek\.com|chat\.mistral\.ai)$
210 characters
Page referrer, matches regex
^https?://((www\.)?(chatgpt\.com|perplexity\.ai|copilot\.com|grok\.com|meta\.ai)|chat\.openai\.com|claude\.ai|gemini\.google\.com|copilot\.cloud\.microsoft|copilot\.microsoft\.com|chat\.deepseek\.com|chat\.mistral\.ai)(/.*)?$
225 characters
5. Test your regex
A hostname is read as Source. A full URL is read as Page referrer. A link with utm_source is read as the Source GA4 takes from it. The whole value has to match, as in GA4, and case is ignored, as in channel groups. Up to 200 lines.
Paste values to see which ones match.
Your count is a floor
Some apps and in-app browsers send no referrer, and some links strip it. GA4 then has no clear source and logs the visit as (direct) / (none). Whatever this regex counts is the least AI traffic you got, never the total.
Next: see which AI answers name you
This regex counts the visits AI assistants send you. The AY Rank AI visibility checker in our app shows whether ChatGPT, Gemini, Perplexity, Claude and Google's AI answers name your brand at all.
Tick the assistants
They all start ticked. Untick the ones you don't need.
Copy the regex
The builder escapes every dot and anchors the regex with ^ and $, so lookalikes such as notchatgpt.com do not match.
Add the channel
Follow six steps to put an "AI assistants" channel above Referral in a custom channel group.
Test it
Paste hostnames, referrer URLs or tagged links and see which match, with the full-match rule GA4 uses.
Clients ask us how to see ChatGPT traffic in GA4. GA4's default channel group now has an AI Assistant channel, but Google's help page does not list the referrers behind it. Your own channel uses a list you can read, change and test, and its Source rule also catches tagged links such as utm_source=chatgpt.com.
How GA4 matches a regex
- A GA4 regex has to match the whole value. Google's help page says: "By default, Google Analytics Regex is full regex and case sensitive. Partial regex requires the user to add metacharacters."
- Both regexes start with ^ and end with $. A full match and a partial match then give the same answer, so the same regex works in a channel group, a report filter or an exploration.
- Channel groups ignore case. Google says "Channel definitions aren't case sensitive." Exploration filters do not ignore case, since "the expression used is case sensitive." The regex is all lower case.
- A channel condition can use Campaign id, Campaign name, Default channel group, Manual ad content, Medium, Source or Source platform. Page referrer is not on that list, so the channel rule uses Source. Google's example of a Source value for a referring site is "facebook.com".
- utm_source fills Source, so a link tagged utm_source=chatgpt.com has chatgpt.com as Source. Google also says "Missing UTM parameters will result in (not set) values being present in reporting." A Source rule still catches those visits when the medium is (not set).
- Order decides. Google says "Traffic is included in the first channel whose definition it matches given the current order of channels in the group." For AI traffic it says to reorder the list so that "AI Assistants" appears above "Referrals".
- GA4's default channel group has an AI Assistant channel. Google says "The medium is set to 'ai-assistant' and the campaign is set to '(ai-assistant)' if the referrer matches a list of AI Assistants", and that the channel "excludes Google's AI Overviews and AI Mode." The help page does not list which referrers it checks.
- A standard property can have 2 custom channel groups and a 360 property 5, each with up to 50 channels.
- The Google pages we read state no length limit for a regex. The builder keeps it short and shows the character count. With all 9 assistants ticked, the Source regex is 210 characters.
- Google's own example regex on the custom channel group page uses broad patterns such as .*gpt.* and .*copilot.*. Even under a full match those match any source that contains those letters. This builder lists exact hostnames instead.
Where each domain comes from
Checked on 2026-11-11. Vendors move domains. Microsoft now redirects copilot.microsoft.com to copilot.com, and Mistral renamed Le Chat to Mistral Vibe. Refresh this list every few months.
Documented by the vendor The vendor names the domain in its own docs. The quote is under it.The vendor's app domain The product is served from this domain, linked from the vendor's site. It shows up as the referrer when the browser sends one.
ChatGPT (OpenAI)
(www.)chatgpt.comDocumented by the vendorChatGPT automatically includes the UTM parameter utm_source=chatgpt.com in referral URLs, enabling clear tracking and analysis of inbound traffic from ChatGPT search results.
chat.openai.comThe vendor's app domainOn 2026-11-11 this host answered with a 308 redirect to chatgpt.com. Older links and bookmarks still point at it.
OpenAI Help Center, Publishers and Developers FAQ
On 2026-11-11 the help URL redirected to a different article, so the quote comes from the Wayback Machine copy of 2026-10-04. Archived copy
Perplexity (Perplexity AI)
(www.)perplexity.aiThe vendor's app domain
Claude (Anthropic)
claude.aiThe vendor's app domain
Gemini (Google)
gemini.google.comThe vendor's app domain
Google Gemini site (gemini.google redirects to gemini.google.com)
Microsoft Copilot (Microsoft)
(www.)copilot.comDocumented by the vendorGo to www.copilot.com to access the web app.
copilot.cloud.microsoftDocumented by the vendorWeb: Go to copilot.cloud.microsoft
copilot.microsoft.comThe vendor's app domainOn 2026-11-11 this host answered with a 301 redirect to copilot.com. Older links and bookmarks still point at it.
Microsoft Support, Get started with the Microsoft Copilot app
DeepSeek (DeepSeek)
chat.deepseek.comThe vendor's app domain
Grok (xAI)
(www.)grok.comDocumented by the vendorGo to grok.com on web, or grab the iOS and Android apps.
Meta AI (Meta)
(www.)meta.aiDocumented by the vendorMuse Spark now powers the Meta AI assistant in the Meta AI app and meta.ai
Meta Newsroom, Introducing Muse Spark: Meta's Most Powerful Model Yet
Mistral Vibe (formerly Le Chat) (Mistral AI)
chat.mistral.aiThe vendor's app domain
Mistral AI, Mistral Vibe (formerly Le Chat), links to https://chat.mistral.ai
Left out
Google Analytics sources
Read on 2026-11-11. The quotes on this page are copied from these pages.
- Google Analytics Help, Custom channel groupshttps://support.google.com/analytics/answer/13051316?hl=en
- Google Analytics Help, About regular expressions (regex)https://support.google.com/analytics/answer/1034324?hl=en
- Google Analytics Help, Default channel grouphttps://support.google.com/analytics/answer/9756891?hl=en
- Google Analytics Help, Data differences between reports and explorationshttps://support.google.com/analytics/answer/9371379?hl=en
- Google Analytics Help, Understand (direct) / (none) traffichttps://support.google.com/analytics/answer/15258820?hl=en
- Google Analytics Help, Traffic-source dimensionshttps://support.google.com/analytics/answer/15567068?hl=en
- Google Analytics Help, URL builders: Collect campaign data with custom URLshttps://support.google.com/analytics/answer/10917952?hl=en
Frequently Asked Questions
What does utm_source=chatgpt.com mean?
OpenAI adds it to links that ChatGPT sends people to. OpenAI's help center says "ChatGPT automatically includes the UTM parameter utm_source=chatgpt.com in referral URLs." GA4 reads utm_source as the Source, so these visits show chatgpt.com as Source even when the browser sends no referrer.
Doesn't GA4 already have an AI channel?
Yes. Google's help page lists an AI Assistant channel in the default channel group, for sources like ChatGPT, Gemini, DeepSeek, Copilot and Grok. It does not list the referrers behind it. Build your own channel when you want a list you can read, change and test.
Why is my AI traffic lower than I expected?
The count is a floor. Some apps and in-app browsers send no referrer, and some links strip it. Google says traffic without a clear referral source is logged as (direct) / (none), and that URL shorteners can strip referral details. A visit only reaches your AI channel when GA4 gets a referrer or a utm_source.
Can this track Google AI Overviews and AI Mode?
No. Google says its own AI Assistant channel "excludes Google's AI Overviews and AI Mode." This regex has no Google Search domain in it, so it does not count those clicks either.
Why does the channel rule use Source and not Page referrer?
Google lists the fields a channel condition can use: Campaign id, Campaign name, Default channel group, Manual ad content, Medium, Source and Source platform. Page referrer is not one of them. Use the Page referrer regex in explorations instead.
Does the new channel show past data?
Yes. Google says "Custom channel groups can be applied to your reports retroactively."
Want us to fix this for you?
We set up AI traffic tracking in GA4 and work on getting your brand named in AI answers, so your AI assistants channel has visits to count.