Free tool · GA4 AI Traffic Regex Generator

Track ChatGPT and AI traffic in GA4.

Generate a precise regex for Google Analytics 4 that groups visits from ChatGPT, Perplexity, Gemini, Claude, Copilot and other AI assistants into their own channel. Test it against your own traffic sources, then follow the step-by-step setup.

  • Free
  • 10 AI platforms
  • Built-in tester
  • Nothing stored

The generator

Choose your AI platforms. Copy your regex.

The regex is anchored to whole domain names, so “you.com” never catches “youtube.com”, unlike the loose patterns often shared online.

01 AI platforms to include

02 Your regex

For channel groups (“matches regex”)
^(.*\.)?(chatgpt\.com|chat\.openai\.com|perplexity\.ai|gemini\.google\.com|bard\.google\.com|claude\.ai|copilot\.microsoft\.com|chat\.deepseek\.com|grok\.com|meta\.ai|chat\.mistral\.ai)$
For report filters (“partially matches regex”)
(^|\.)(chatgpt\.com|chat\.openai\.com|perplexity\.ai|gemini\.google\.com|bard\.google\.com|claude\.ai|copilot\.microsoft\.com|chat\.deepseek\.com|grok\.com|meta\.ai|chat\.mistral\.ai)$

11 domains, 186 characters. Subdomains such as www are included automatically.

03 Test it

6 of 9 sources would be counted as AI traffic.

  • chatgpt.comCounted as AI
  • perplexity.aiCounted as AI
  • www.perplexity.aiCounted as AI
  • gemini.google.comCounted as AI
  • claude.aiCounted as AI
  • googleNot matched
  • youtube.comNot matched
  • linkedin.comNot matched
  • chat.openai.comCounted as AI

How to set up an AI channel in GA4

These steps follow Google's own guidance on custom channel groups. You need Editor access or above.

  1. Open Channel groups

    In GA4, go to Admin, then under Data display click Channel groups.

  2. Create a new group

    Click Create new channel group. It starts as a copy of the default group. Name it something like “Channels with AI”.

  3. Add an AI channel

    Click Add new channel and name it “AI assistants”.

  4. Add the condition

    Choose Source, then matches regex, and paste: ^(.*\.)?(chatgpt\.com|chat\.openai\.com|perplexity\.ai|gemini\.google\.com|bard\.google\.com|claude\.ai|copilot\.microsoft\.com|chat\.deepseek\.com|grok\.com|meta\.ai|chat\.mistral\.ai)$

  5. Move it above Referral

    Save the channel, click Reorder and drag “AI assistants” above Referral. GA4 puts each visit in the first channel it matches. If the group also contains GA4's built-in AI Assistant channel, place yours above that too, so AI traffic isn't split across two rows.

  6. Save and report

    Click Save group. Then open Reports, Acquisition, Traffic acquisition and switch the primary dimension to your new channel group.

Want us to set it up and report on it?

We'll configure AI traffic tracking in your GA4 property, check what's being misattributed, and reply personally with what your AI traffic is telling you. Free, with no obligation.

Thanks, we've got it. We'll be in touch personally.

The guide

How do I track ChatGPT traffic in GA4?

Create a custom channel group with a channel called “AI assistants”, set its condition to Source matches regex, paste a regex listing the AI platforms' domains, and move the channel above Referral. GA4 then reports AI visits as their own channel in the Traffic acquisition report.

GA4 also has a built-in AI Assistant channel. A custom channel is still worth setting up, because it lets you decide exactly which platforms count and see each one clearly.

Does GA4 have its own AI channel?

Yes. According to Google's channel definitions, the default channel group now includes an AI Assistant channel for visits “from sources like ChatGPT, Gemini, Deepseek, Copilot, or Grok”. GA4 sets the medium to “ai-assistant” when the referrer matches its list.

Two limits are worth knowing:

  • Google doesn't publish the full list of sources it counts, so you can't be sure which platforms are included.
  • It excludes Google's own AI Overviews and AI Mode.

A custom channel group built from the regex above puts you in control of the definition, and you can use both side by side.

Why does ChatGPT traffic show as Direct?

GA4 can only attribute a visit to ChatGPT if it receives a referrer or a campaign tag. Some AI traffic arrives with neither:

  • Apps and in-app browsers often don't pass a referrer, so visits from the ChatGPT or Perplexity mobile apps can land in Direct.
  • Copied links pasted into a new tab carry no referrer at all.
  • Inconsistent tagging. ChatGPT often adds utm_source=chatgpt.com to links it cites, which GA4 reads as the source, but not every link carries it.

That means any AI channel undercounts. Treat it as a reliable minimum, and watch for unexplained rises in Direct traffic to pages that AI tools tend to cite.

Can you track Google AI Overviews traffic in GA4?

Not separately. Clicks from AI Overviews and AI Mode arrive as ordinary Google organic traffic. According to Google's documentation, they're included in Search Console's Performance report within the “Web” search type, but there's no filter to separate them from regular results.

Which AI platforms does the regex cover?

AI platforms and the source domains they appear as in GA4
PlatformCompanySource domains
ChatGPTOpenAIchatgpt.com, chat.openai.com
PerplexityPerplexityperplexity.ai
GeminiGooglegemini.google.com, bard.google.com
ClaudeAnthropicclaude.ai
Microsoft CopilotMicrosoftcopilot.microsoft.com
DeepSeekDeepSeekchat.deepseek.com
GrokxAIgrok.com
Meta AIMetameta.ai
Le ChatMistral AIchat.mistral.ai
You.comYou.comyou.com

bard.google.com is Gemini's former address, kept so older links still count. AI platforms change domains from time to time, so check the Source column of your Traffic acquisition report every few months and add anything new using the field above.

How the regex works

Google Analytics regex is full-match and case-sensitive by default, which trips up a lot of copied patterns. The generated regex is built for that:

  • ^ and $ make it match the whole source, so a lookalike domain doesn't slip through.
  • (.*\.)? allows any subdomain, such as www.perplexity.ai.
  • Dots are escaped as \., so they match a literal dot rather than any character.

Use the first version wherever GA4 asks for “matches regex”, such as channel group conditions. Use the second where it offers “partially matches regex”, such as some report filters.

How to check it's working

  1. Open Traffic acquisition with your new channel group as the primary dimension and look for the “AI assistants” row.
  2. Add Session source as a secondary dimension to see which platforms are sending visits.
  3. Switch back to the default channel group and filter the Referral channel for AI domains. If any appear, a domain is missing from your regex.

Frequently asked questions

Does GA4 have a built-in AI traffic channel?

Yes. GA4's default channel group now includes an AI Assistant channel, which Google describes as covering sources like ChatGPT, Gemini, DeepSeek, Copilot and Grok. Google doesn't publish its full list of sources, and the channel excludes Google's own AI Overviews and AI Mode. A custom channel group lets you decide exactly which platforms count.

Do custom channel groups apply to historical data?

Yes. Google says custom channel groups can be applied to your reports retroactively, so once you've created the group you can look back at past AI traffic, not just new visits.

How many custom channel groups can I create?

Standard GA4 properties can have 2 custom channel groups in addition to the default group, each with up to 50 channels. GA4 360 properties can have 5.

Why is my AI channel showing zero sessions?

The most common cause is channel order. GA4 puts each visit in the first channel it matches, so if your AI channel sits below Referral, AI visits are counted as Referral. Drag it above Referral. Also check the regex was pasted exactly, because GA4 regex is full-match and case-sensitive.

Is GA4 regex case-sensitive?

Yes. Google Analytics regex is case-sensitive and full-match by default. Traffic sources are normally lowercase, which is why the generated regex uses lowercase domains.

Does this track AI crawlers such as GPTBot?

No. GA4 measures visits from people's browsers. AI crawlers fetch your pages without running analytics code, so they don't appear in GA4. To see crawler activity, check your server logs or your host's bot reports.

Is anything I enter stored?

No. The regex is built and tested in your browser, and nothing you enter is sent or saved.

Keep going

Free · Up to 28 prompts

AI Visibility Prompt Generator

What are your buyers asking AI? Generate the prompts to test in ChatGPT, Perplexity and Gemini, with a free sheet to track whether AI mentions you.

Free · 18 AI bots

AI robots.txt and llms.txt Generator

Decide which AI bots can read your site. Build robots.txt rules for 18 verified AI crawlers, check your current file and create an llms.txt.

Free · 3 minutes

AI Search Readiness Scorecard

Is your website AI-friendly? Fifteen questions show how likely ChatGPT, Perplexity, Gemini and Google AI Overviews are to recommend your brand, with a prioritised fix list.

Next step

AI traffic is a signal. Let's grow it.

Seeing AI visits in GA4 is the first step. Getting cited more often is the next, and that's what our AEO and GEO work is built for.