Free tool

Track AI assistant traffic in GA4

GA4 lumps visits from ChatGPT, Perplexity and other assistants in with Referral. To see them on their own, add a channel whose rule is “Session source matches regex” with the pattern below. Pick the assistants, copy the regex, and follow the steps.

Which AI assistants?
GA4 regex (Session source matches regex)
^(.*\.)?(chatgpt\.com|chat\.openai\.com|perplexity\.ai|claude\.ai|gemini\.google\.com|bard\.google\.com|copilot\.microsoft\.com|grok\.com|chat\.deepseek\.com|meta\.ai)$

168 characters. If GA4 rejects a long pattern, select fewer assistants or split it across two conditions joined with OR.

Referrer URL regex (for tools that filter the full referrer)
^https?://([^/]*\.)?(chatgpt\.com|chat\.openai\.com|perplexity\.ai|claude\.ai|gemini\.google\.com|bard\.google\.com|copilot\.microsoft\.com|grok\.com|chat\.deepseek\.com|meta\.ai)(/|$)
Plain domain list (for tools that take a list of sources)
chatgpt.com
chat.openai.com
perplexity.ai
claude.ai
gemini.google.com
bard.google.com
copilot.microsoft.com
grok.com
chat.deepseek.com
meta.ai

Option 1: an “AI assistants” channel in GA4

This adds AI traffic to your standard acquisition reports, for past and future sessions.

  1. In GA4, go to Admin, then under Data display click Channel groups.
  2. Click Create new channel groupand give it a name, such as “Channels with AI”. (Or copy the default group so you keep all the standard channels.)
  3. Click Add new channel, name it “AI assistants”, then add a condition: Session source → matches regex→ paste the GA4 regex.
  4. Click Save channel. Then click Reorderand drag “AI assistants” above Referral. GA4 uses the first channel that matches, so order matters.
  5. Click Save group. In Reports → Acquisition → Traffic acquisition, switch the primary dimension to your new channel group.

Steps follow Google’s custom channel group guide. Standard GA4 properties allow two custom channel groups.

Option 2: a quick exploration

Use this to look at AI traffic without changing any settings.

  1. Go to Explore and start a Free form exploration.
  2. Add the dimensions Session source and Landing page, and the metrics you care about, such as Sessions and Key events.
  3. Add a filter: Session source → matches regex → paste the GA4 regex. Put Session source in rows to see each assistant, or Landing page to see which pages AI sends people to.

Other analytics tools

Tools like Plausible and Matomo differ in what their filters accept. If a filter takes a regular expression on the full referrer URL, use the referrer URL regex. If it takes a list of sources or domains, use the plain domain list.

Domains in the pattern

AI assistants and the referrer domains the regex matches
AssistantDomains matchedSelected by default
ChatGPTchatgpt.com, chat.openai.comYes
Perplexityperplexity.aiYes
Claudeclaude.aiYes
Geminigemini.google.com, bard.google.comYes
Microsoft Copilotcopilot.microsoft.comYes
Grokgrok.comYes
DeepSeekchat.deepseek.comYes
Meta AImeta.aiYes
Mistral Le Chatchat.mistral.aiNo
You.comyou.comNo

Each domain also matches its subdomains (for example www.perplexity.ai), but not look-alike domains. The pattern is anchored at both ends, so it works in fields that match the whole value and in fields that match part of it.

FAQ

How do I see ChatGPT traffic in GA4?

Visits from links in ChatGPT usually arrive with chatgpt.com as the session source. Create a custom channel group with a channel whose condition is Session source matches regex, paste the pattern from this page, and move that channel above Referral. Then pick the channel group in the Traffic acquisition report.

Why does the channel need to sit above Referral?

GA4 puts each session in the first channel whose definition it matches, in the order the channels are listed. If Referral comes first, AI visits are counted as Referral and your AI channel stays empty.

Will it show my past AI traffic?

Yes. Google says custom channel groups can be applied to your reports retroactively, so the new channel also sorts earlier sessions.

Why is my AI traffic lower than I expected?

Some clicks from AI apps arrive without a referrer, and GA4 counts those as Direct. This pattern can only catch visits that carry the assistant's domain, so treat the number as a minimum.

Which domains does the pattern use?

The web app domain of each assistant you select. ChatGPT, Perplexity, Claude, Gemini and Copilot are the same domains GEOHATS uses to attribute AI visits on pages it publishes. You can add other domains in the optional field.

Learn more

More free tools

By Daniel Borodin, GEOHATS founder · Last updated