Guide

How to track AI referrals in GA4

Shaheer Malik
Shaheer Malik
Founder, WebValet
4 min readUpdated

The short answer

Create a custom channel group in GA4 with a new channel called 'AI assistants'. Match the session source against a regex of AI domains, such as chatgpt.com and perplexity.ai. Place the channel above Referral so those visits land there. Expect gaps, because many AI visits arrive without a referrer and show as Direct.

  • GA4 can only count AI visits that arrive with a referrer or a UTM tag.
  • A custom channel group keeps AI traffic separate from ordinary referrals.
  • Clicks from Google AI Overviews show as Google organic and cannot be separated in GA4.
  • Treat the numbers as a minimum, not the full picture.

What can GA4 see from AI answers?

When someone clicks a link in an AI answer, the browser may pass a referrer. A referrer is the address of the page they came from. GA4 then records a source, such as chatgpt.com.

That does not always happen. Mobile apps, privacy settings and copied links can strip the referrer. Those visits usually show up as Direct.

Clicks from Google AI Overviews and AI Mode arrive from google.com. GA4 records them as google / organic, mixed in with normal search clicks.

Some buyers read an AI answer and later search your name or type your address. GA4 cannot link those visits back to the AI answer at all.

AI referral numbers in GA4 show a floor, not the true total of AI influence.

How to set up an AI channel in GA4, step by step

Menu names in GA4 change from time to time. If a label differs, search Google's Analytics help for 'custom channel groups'.

  1. 1

    Check your access

    You need the Editor role or higher on the GA4 property. Ask the property owner if you cannot see the Admin settings.

  2. 2

    Open channel groups

    Go to Admin, then Data display, then Channel groups. You will see the default channel group there.

  3. 3

    Create a new group from the default

    Create a new channel group that starts as a copy of the default. This keeps Organic Search, Paid Search and the rest intact.

  4. 4

    Add an 'AI assistants' channel

    Add a channel named 'AI assistants'. Set the condition to Session source, matches regex, and paste the regex from the next section.

  5. 5

    Move it above Referral

    GA4 assigns each session to the first channel it matches. If Referral sits higher, it will claim the AI visits first.

  6. 6

    Save and use it in reports

    Open Reports, then Acquisition, then Traffic acquisition. Switch the primary dimension to your new channel group.

  7. 7

    Review the domain list each quarter

    New assistants launch and domains change. Check your Referral list for new AI sources and add them to the regex.

A regex for common AI referrers

A regex, or regular expression, is a pattern for matching text. GA4 uses a syntax called RE2. The pattern below matches the listed domains, including their subdomains.

The list covers common assistants at the time of writing. Domains change, so check your own Referral data for others. ChatGPT often adds utm_source=chatgpt.com to the links it shows, which helps GA4 attribute those visits.

^.*(chatgpt\.com|chat\.openai\.com|perplexity\.ai|gemini\.google\.com|copilot\.microsoft\.com|claude\.ai).*$

How to check it worked

Open Traffic acquisition with your new channel group selected. The 'AI assistants' row should appear once matching visits arrive.

Next, switch back to Session source / medium. The AI domains should no longer appear under Referral for dates after your change.

For a live test, ask an AI assistant a question that cites your site. Click the link in a private browser window, then look for the visit in the Realtime report.

WebValet Pro connects to GA4 and Search Console with read-only access and explains the trends in plain English. It also tracks buyer prompts weekly on ChatGPT, Gemini and Perplexity. These tracking features are rolling out now.

Common mistakes when tracking AI referrals

Most errors come from overtrusting the numbers or from small setup slips.

  • Editing the default channel group instead of creating a new one.
  • Leaving the AI channel below Referral, so it never matches.
  • Forgetting to escape the dots in domain names inside the regex.
  • Reading low AI referral numbers as proof that AI answers do not matter.
  • Expecting GA4 to separate Google AI Overviews clicks from normal search.
  • Never updating the regex as new assistants appear.

Questions people ask

Why do I see almost no AI traffic in GA4?

Many AI visits arrive with no referrer and count as Direct. Your brand may also be mentioned without a link. Low numbers can mean missing data, not missing influence.

Will the new channel show data from before I created it?

Check your reports for dates before the change, because Google's behavior here can be updated. If earlier dates do not show it, use an exploration filtered by session source for historical data.

Can I track Microsoft Copilot referrals even if my tracking tool does not cover Copilot?

Yes. GA4 records any referrer the browser passes, including copilot.microsoft.com. That is separate from checking what Copilot answers say about you.

Does WebValet replace GA4?

No. WebValet Pro reads your GA4 data with read-only access and puts it next to AI answer tracking. GA4 stays your source of truth for site traffic.

Put it to work

Check it, track it, or have it done

No trial and no lock-in. Start free, then choose.

  1. 01 · Start here

    Free check

    $0no signup

    See how ready your site is for Google and AI crawlers. About 20 seconds.

    Run a free check
  2. 02 · Track it weekly

    Pro

    $19/month · or $190/year

    25 buyer prompts on ChatGPT, Gemini and Perplexity, against 3 competitors. No trial, cancel anytime.

    Get Pro
  3. 03 · Done for you

    Hire Team Shaheer Malik

    $249/month · Pro included

    Shaheer's team does your SEO and GEO every month: pages, citations, listings and fixes.

    Schedule a call