Skip to content

Track AI referral traffic in GA4

See sessions from ChatGPT, Perplexity, Gemini and others in GA4.

  • Lesson 6 of 6
  • Intermediate
  • 6 min read
  • Checked against the product 2026-11-03

In shortVisits from ChatGPT, Perplexity, Gemini, Claude and Copilot reach GA4 with a session source such as chatgpt.com, perplexity.ai or gemini.google.com, mixed into Referral (or Direct when no referrer is passed). To see them as one number, filter or segment on session source with a regex, or add an AI channel group in GA4 Admin. In AI Rank Lab, the GA4 overview's Top AI Sources chart and Analytics chat give you the same view without building reports.

What AI referral traffic is

When an AI assistant answers a question, it often links to the pages it used. Some people click. Those visits are AI referral traffic: real people, sent by an AI answer. They're worth tracking because they show which pages AI engines cite and whether those citations turn into visits and sales.

GA4 already records these visits. The problem is that it files them under the Referral channel, next to forums and partner sites, so nobody notices them. This lesson shows how to pull them out in GA4 itself, and how AI Rank Lab helps.

Which sources to look for

AssistantSession source in GA4Notes
ChatGPTchatgpt.com (older visits: chat.openai.com)Many ChatGPT links add utm_source=chatgpt.com, so the source shows even without a referrer
Perplexityperplexity.aiSometimes with www.
Geminigemini.google.comSeparate from google / organic
Claudeclaude.ai
Microsoft Copilotcopilot.microsoft.comCopilot inside Bing search can arrive as bing.com
Google AI Overviews and AI Modegoogle / organicCan't be separated from normal Google results in GA4
Treat the number as a floor

Some AI apps and in-app browsers pass no referrer, so the visit lands in (direct) / (none) and no tool can reliably attribute it. Clicks from Google AI Overviews look like ordinary organic search. Report AI sessions as "at least", and say how you counted them.

Build the view in GA4

All of these use one regex on session source. Wrapping it in .* makes it work whether a GA4 field does full or partial matching:

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

  1. Quick check in a standard reportIn GA4, open Reports → Acquisition → Traffic acquisition. Change the primary dimension to Session source / medium and type "chatgpt" in the search box. This answers "do we get any?" in a minute.
  2. Build an explorationOpen Explore → Free form. Add the dimensions Session source and Landing page + query string, and the metrics Sessions, Engaged sessions and Key events. Add a filter: Session source matches regex, with the regex above. Put Session source in rows to compare assistants, or Landing page to see which pages AI sends people to.
  3. Save a segment to compareIn the exploration, create a session segment with the condition Session source matches the same regex. Apply it next to an Organic Search segment to compare engagement rate and key events side by side.
  4. Add an AI channel (optional, needs Editor)In Admin → Data display → Channel groups, create a new channel group (it starts as a copy of the default). Add a channel such as "AI assistants" with the condition Source matches the regex, then move it above Referral so GA4 assigns those sessions to it first. Save, then pick this channel group in your acquisition reports.
Extend the list as new assistants appear

Check your Referral channel every month or so for new AI domains and add them to the regex in every place you use it: the exploration filter, the segment and the channel group.

How AI Rank Lab helps

  1. Read Top AI Sources in the GA4 overviewOpen Analytics → Google Analytics 4 → GA4 overview. Top AI Sources lists up to five AI session sources for the chosen date range, and Traffic Distribution shows their share of all sessions. It's free and needs no setup in GA4. Its AI list includes "bing", so plain Bing search visits are counted too.
  2. Ask follow-up questions in Analytics chatIn Analytics → Google Analytics 4 → Analytics chat, ask "top 10 landing pages for sessions from chatgpt.com in the last 28 days" or "engagement rate by session source for perplexity.ai and google". Each message costs credits; see Analytics chat.
  3. Connect clicks to citationsVisits are the end of the chain. AI search → Brand visibility → Citations shows which of your URLs AI engines cite for the prompts you run. When citations rise but AI sessions don't, look at the cited pages' titles and first paragraphs.

The AI bot tracker is a separate measure

AI Rank Lab's AI bot tracker (AI search → Monitoring and reports → AI bot tracker) does not read GA4. It uses its own JavaScript tag on your site, decides whether a visit came from an AI assistant by its referrer or user agent, and shows AI-referred visits per page and per assistant. It stores UTM parameters but doesn't use them to classify, so a ChatGPT click that carries only utm_source=chatgpt.com and no referrer isn't counted as AI there. Because it's a browser tag, it sees people and agents that run JavaScript, not crawlers that fetch pages without running scripts. Its numbers won't match GA4 exactly: the two count differently, and consent settings or ad blockers affect them differently. Use GA4 as your official figure and the tracker for the per-page view. See Read the AI bot tracker.

What it costs

Check yourself

1. Where do clicks from Google AI Overviews show up in GA4?
2. Why build your AI regex on session source rather than on the page referrer?
3. Your AI bot tracker shows different AI visit numbers from GA4. Which statement is right?

0 of 3 answered.

Progress is saved in this browser.

Put the lesson to work

Paste your site and get a free SEO, AEO and GEO audit with the fixes, then come back to the next lesson.