All posts
SEO & AI search

How to Track ChatGPT, Perplexity and AI Traffic in GA4

How to track AI traffic in GA4: the custom channel group, the regex for ChatGPT, Perplexity, Claude, Gemini and Copilot, and why app visits land in Direct.

By Mehdi Hassan8 min read

The short answer

To track AI traffic in GA4, create a custom channel group with an "AI assistants" channel whose session source matches a regex of AI hostnames such as chatgpt.com, perplexity.ai, claude.ai, gemini.google.com and copilot.microsoft.com. Move it above Referral so it matches first. Expect undercounting, because many app visits pass no referrer and land in Direct.

Key takeaways

  • A custom channel group pulls AI referrals out of the general Referral bucket, and it applies to past data.
  • Order is everything: the AI channel must sit above Referral or it never matches.
  • List exact source values as they appear in your own Traffic acquisition report before writing the regex.
  • Visits from AI mobile and desktop apps often arrive without a referrer and count as Direct.
  • Treat the AI channel as a floor, and size the rest with a self-reported attribution field.

Part of Marketing Website Analytics: What B2B Teams Should Actually Measure

Why track AI traffic in GA4 separately?

You track AI traffic separately because GA4's default channel group files visits from ChatGPT, Perplexity and Claude under Referral, mixed in with partner sites, directories and random backlinks. Pulling them into their own channel shows how much traffic AI tools send, which pages they send it to, and whether those visitors convert.

That last part is the point. In TripleDart's study of 28 B2B SaaS companies in Q1 2026, ChatGPT sent 72% of the AI-referred sessions, and homepages received 81.7% of AI-attributed leads. If AI visitors land mostly on your homepage and pricing page, those pages need to be built for someone who already has a shortlist. You can't know that until the traffic is visible.

This guide is one part of our hub on marketing website analytics, which covers the full metric set a B2B site should track. Here we go step by step through the GA4 setup, then explain what it can't catch.

Which sources count as AI traffic?

AI traffic is any visit referred by an AI assistant or answer engine. In 2026 the main sources for B2B sites are ChatGPT, Perplexity, Claude, Gemini and Microsoft Copilot. Google AI Overviews and AI Mode are not separable in GA4, because those clicks arrive from google.com like any organic visit.

Tool

Source value you'll usually see

Notes

ChatGPT

chatgpt.com

Older visits may show chat.openai.com. Many links carry utm_source=chatgpt.com.

Perplexity

perplexity.ai

Sometimes appears with www. in front

Claude

claude.ai

Usually lower volume; varies by category

Gemini

gemini.google.com

Separate from Google organic search

Copilot

copilot.microsoft.com

Some visits arrive via bing.com and count as organic

Google AI Overviews / AI Mode

google

Counted as Organic Search. Not separable in GA4.

Before writing any regex, open Reports, then Acquisition, then Traffic acquisition, switch the dimension to Session source, and search for each name. Use the exact values your property records. Hostnames vary over time, and a regex built from a blog post rather than your own data is the most common reason the channel shows nothing.

How do you set up an AI channel group in GA4?

You set up an AI channel group by copying GA4's default channel group, adding a new channel with a session source regex, and placing it above Referral. It takes about ten minutes and needs Editor access to the property.

  1. Open channel groups

    In GA4, go to Admin, then Data display, then Channel groups. Click Create new channel group. GA4 starts you with a copy of the default channels.

  2. Name the group

    Call it something clear, like "Default + AI", so nobody confuses it with the standard grouping.

  3. Add a new channel

    Click Add new channel and name it "AI assistants". Set the condition to Session source, matches regex.

  4. Paste the regex

    Use the exact hostnames from your own report. A starting point: (chatgpt\.com|chat\.openai\.com|perplexity\.ai|www\.perplexity\.ai|claude\.ai|gemini\.google\.com|copilot\.microsoft\.com)

  5. Move it above Referral

    Channels are evaluated from top to bottom and a visit takes the first match. Drag AI assistants above Referral, and above Organic Search if any AI source could also match there.

  6. Save and check

    Save the group, open the Traffic acquisition report and switch the primary dimension to your new channel group. Custom channel groups apply to historical data, so past AI visits should appear straight away.

  7. Add it to your reports

    Use the new channel group in explorations and in your monthly report, next to conversions by channel, so AI traffic is judged by leads and not just sessions.

Why does AI traffic from apps land in Direct?

AI traffic from apps lands in Direct because many mobile and desktop apps open links without passing a referrer. GA4 needs either a referrer or UTM parameters to attribute a visit. With neither, it has no source to record, so the session is filed as Direct with source "(direct)".

This is the biggest gap in GA4's view of AI. A buyer who asks the ChatGPT phone app for vendor recommendations and taps your link may never show up in your AI channel. The same goes for someone who copies your URL from an answer and pastes it into a browser later, or types your brand name into Google after reading about you.

  • UTM tags help where the tool adds them. ChatGPT appends utm_source=chatgpt.com to many links it shows, which GA4 picks up even without a referrer.
  • Apps and copy-paste don't. No tag, no referrer, no attribution.
  • Branded search absorbs some of it. A buyer who reads about you in an AI answer and then searches your name counts as organic.
How to estimate hidden AI traffic in Direct

You can't measure hidden AI traffic exactly, but you can look for its shape. Filter Direct sessions by landing page and exclude the homepage. People rarely type a long URL like a specific comparison page by hand, so rising Direct traffic to deep pages, with no campaign or email to explain it, often points to AI referrals or shared links.

Then compare against what buyers tell you. A "How did you hear about us?" field with ChatGPT and Perplexity as visible options gives a second count. If self-reported AI mentions are several times higher than your AI channel's conversions, you know the GA4 number is a floor. Our guide to self-reported attribution covers how to add the field.

How do you check whether AI visitors convert?

You check whether AI visitors convert by comparing key events per session for the AI channel against your other channels, broken down by landing page. Raw conversion rate is less useful than knowing which pages AI tools send people to and whether those pages turn them into qualified leads.

  1. Mark your demo, contact and trial submissions as key events, if they aren't already.
  2. Build a free-form exploration with your custom channel group as rows and landing page as a secondary dimension.
  3. Add sessions, key events and session key event rate as values.
  4. Filter to the AI assistants channel and sort by sessions to see which pages AI tools send traffic to.
  5. Compare those pages' conversion rates for AI visitors against organic visitors on the same pages.

Small samples make this noisy for most startups. Look at a quarter at a time and pay more attention to which pages receive AI traffic than to precise rates. For what the wider data says, read does AI search traffic convert, and for how to design the pages those visitors land on, see our guide to landing pages for visitors arriving from ChatGPT.

What else should you track alongside the GA4 channel?

Alongside the GA4 channel, track whether you appear in AI answers at all and what buyers say brought them. GA4 only sees clicks. A brand can be mentioned in hundreds of AI answers a month and receive almost no traffic, especially in tools like Gemini that cite few sources.

How should you report AI traffic to leadership?

Report AI traffic as one line in your channel table, with sessions, qualified conversions and the trend, plus a note that the number undercounts. Leadership needs to know the direction and the caveat, not the regex.

A useful framing is three numbers side by side: AI channel sessions from GA4, AI-attributed conversions from GA4, and AI mentions from the self-reported field. The gap between the last two is the dark share that GA4 can't see. If that gap is large, it argues for investing in the pages and mentions that AI tools draw on, even when the tracked channel looks small. Our SEO reporting template for B2B shows where this sits on a one-page report.

Frequently asked questions

Does GA4 have a built-in AI channel?
GA4's default channel group doesn't separate AI assistants, so ChatGPT and Perplexity visits fall into Referral by default. Google may change the defaults over time, so check your property's channel definitions in Admin. Until there's a built-in channel that matches your sources, a custom channel group is the reliable way to report AI referrals on their own.
Will a custom channel group change my historical data?
Custom channel groups in GA4 apply to historical data in reports, so past AI visits appear in the new channel once you save it. They don't alter the raw data or the default channel group, which stays as it was. That makes them safe to experiment with: you can edit or delete the group without losing anything.
Can I see which ChatGPT prompts sent visitors?
No. ChatGPT and other assistants don't pass the user's prompt to your site, and GA4 only receives the source and sometimes a UTM tag. To learn which questions surface your brand, run a prompt audit yourself, asking AI tools the questions buyers ask, and ask converted leads what they searched in a self-reported field.
Should I use session source or first user source?
Use session source for the channel group, because it reflects what brought each visit. First user source is useful separately, in an exploration, to see how many users were first introduced by an AI tool and came back later through another channel. Both are worth looking at, but the channel group itself should be session-scoped.
Why is my AI channel showing zero sessions?
Usually one of three things. The AI channel sits below Referral, so visits match Referral first. The regex lists hostnames your property doesn't actually record. Or your site simply gets very little AI-referred traffic with a referrer, which is common for small sites. Check the order, then compare the regex against your Session source report.

· CEO & Design Director

Copywriter, designer and developer, and founder of Designify Studio. Over five years, 60+ projects across 14+ industries, for startups that have raised $300M+.

Want this done for you? Website, $8,000.

A multi-page marketing site, written and designed by us, developed in Next.js and animated. $8,000, one-time, up to 6 pages. Book a free 30-minute call to see if it fits.

Schedule Call