Skip to content

AI referral tracking: count ChatGPT, Perplexity and Claude visits in GA4

This AI referral tracking generator writes the GA4 channel group rule, the Exploration filter and the Looker Studio formulas that put visits from AI assistants in a channel of their own.

AI assistants to count

Built in your browser. Nothing is uploaded.

7 assistants, 9 session sources, regex 142 characters.

Rules to paste into GA4 and Looker Studio

In GA4: Admin, Data display, Channel groups, Create new channel group, Add new channel. Name it "AI assistants", add the condition Source, matches regex, and paste this. Save, then select Reorder and drag "AI assistants" above Referral: GA4 puts each visit in the first channel it matches.

ga4-ai-channel-regex.txt
^(chatgpt\.com|chat\.openai\.com|perplexity\.ai|www\.perplexity\.ai|gemini\.google\.com|copilot\.microsoft\.com|claude\.ai|you\.com|meta\.ai)$

Before you rely on the numbers

  • ChatGPT adds utm_source=chatgpt.com to the links it shows, so those visits arrive with Source chatgpt.com, which the regex already covers. OpenAI says so in its publishers FAQ.
  • GA4 regex is case sensitive and matches the whole value. Sources are lowercase, which is why the pattern is too.
  • A custom channel group applies to your reports retroactively. A standard GA4 property can have 2 custom channel groups.
  • A visit that arrives with no referrer and no UTM tag, as some app links do, shows up as Direct. No regex can recover it, so read these numbers as a floor, not the total.
  • Free, no account
  • Runs in your browser
  • 7 AI assistants, 9 session sources

What the AI referral tracking rules cover

Tick the assistants you want counted and copy the rules. Built in your browser; nothing is uploaded.

  • GA4 channel group

    An "AI assistants" channel with one Source regex, and where it goes in the list, so the visits stop landing in Referral.

  • Exploration filter

    The same pattern for a Session source filter in an Exploration, anchored so it matches whole values only.

  • Looker Studio formulas

    A CASE formula for the channel and one that names each assistant, written with [.] so no escaping can break them.

  • ChatGPT's own tag

    ChatGPT adds utm_source=chatgpt.com to its links, so tagged visits are counted along with the referrer ones.

  • Pick your assistants

    ChatGPT, Perplexity, Gemini, Microsoft Copilot, Claude, You.com and Meta AI, from the one list of AI referrers getReport keeps for every tool.

  • GA4's limits checked

    GA4 regex is case sensitive and a report filter takes 250 characters at most; the tool counts them for you.

Show 2 more checks
  • Pick your assistants

    ChatGPT, Perplexity, Gemini, Microsoft Copilot, Claude, You.com and Meta AI, from the one list of AI referrers getReport keeps for every tool.

  • GA4's limits checked

    GA4 regex is case sensitive and a report filter takes 250 characters at most; the tool counts them for you.

How AI referral tracking works

  1. Tick the assistants

    All seven are on by default. Untick any you do not want in the channel; the pattern updates as you click.

  2. Copy the rule

    Each output says where to paste it in GA4 or Looker Studio, with the menu names as Google's help pages give them.

  3. Move the channel up

    In GA4, drag the AI assistants channel above Referral. Visits go to the first channel they match, so order decides.

A visit that reaches you without a referrer and without a UTM tag shows up as Direct, and no rule can recover it, so the AI channel is a floor, not the full count.

AI referral tracking questions

How do I track ChatGPT traffic in GA4?

Create a custom channel group with an AI assistants channel whose condition is Source matches regex, using the pattern this tool builds, then move it above Referral. ChatGPT visits arrive with the source chatgpt.com, from the referrer or from the utm_source=chatgpt.com tag ChatGPT adds, and the pattern matches both.

How do I create an AI channel group in GA4?

In GA4 go to Admin, Data display, Channel groups and select Create new channel group, which starts from a copy of the default group. Select Add new channel, name it AI assistants, add the condition Source, matches regex, paste the pattern, save, and reorder so it sits above Referral. A standard property can have 2 custom groups.

Does ChatGPT add UTM parameters to links?

Yes. OpenAI says in its publishers FAQ that ChatGPT includes utm_source=chatgpt.com in the links it shows. GA4 reads that as the source chatgpt.com, the same value a referrer visit gets, so one rule counts both.

Does a custom channel group change my past GA4 data?

It changes how reports show it, not the data. Google says custom channel groups apply to reports retroactively, so the AI assistants channel shows past visits too, and the default channel group stays as it was for comparison.

Why does the regex start with ^ and end with $?

So it matches whole source values only. GA4 regex is a full match by default, but some filters offer partial matching, and the anchors make the pattern behave the same in both. Without them, a partial match on claude.ai would also count a source such as notclaude.ai.

Can I track AI traffic in Looker Studio without GA4 changes?

Yes. Add a calculated field to your GA4 data source and paste the CASE formula: it puts AI assistant visits in their own channel and keeps the default channel for every other visit. The second formula names the assistant, for a breakdown table.

Is this AI referral tracking tool free?

Yes, with no sign-up, and it runs in your browser. getReport is funded by donations, not plans.

All 59 tools →

Free, funded by the people who use it

No account, no paid plan. Donations keep it running.

Chip in