How to Track AI Traffic in GA4, Step by Step (2026)

Flat editorial illustration: three ink arrows enter from the left edge; two of them hit a chartreuse-filled box marked with a small ink label, the third disappears into an empty cream area.

GA4 severely underestimates AI traffic, and much of it ends up in Direct. Here's the setup that captures more, step by step, including the server logs GA4 never sees.

Anabel Hafstad7 min
In this article

This is a follow-up to part 1 of this series, about how AI models search and select sources. I briefly mentioned there that Google Analytics doesn't capture AI traffic well enough on its own, and here I'll walk you through how to actually fix it.

The problem with AI traffic in GA4, in brief

When someone clicks a link inside a ChatGPT or Perplexity answer and lands on your website, it should theoretically count as traffic in GA4. In practice, two things happen that ruin the measurement.

Firstly, Google added a dedicated "AI Assistant" channel in GA4 in May 2026. It automatically captures visits from services like ChatGPT, Gemini, Copilot, DeepSeek, and Grok. But Perplexity isn't on that list and still ends up in the regular "Referral" channel.

Secondly, and this is the bigger problem, between 35 and 70 per cent of all AI referral traffic arrives without any referrer information at all.

ChatGPT only started adding utm_source=chatgpt.com to links from its desktop version in June 2025. The mobile app, and anything cited before that date, still provides no referrer information.

This is worth clarifying, as it's not as well-known as it should be. Many assume that traffic GA4 can't place ends up in “Unassigned”, a sort of “we don't know” bucket. But “Direct” and “Unassigned” are two different mechanisms in GA4:

  • Unassigned occurs when data exists but doesn't match any of the channel rules, typically from a faulty UTM setup.
  • Direct is a precise technical state where the source is set to “direct” and the medium to “(none)”, which is exactly what happens when a browser sends no referrer header at all.

This is precisely the situation with much of the AI traffic, especially links opened in an app, copied and pasted into a new tab, or sent from an in-app browser that deliberately strips referrer data.

Flat illustration: three ink arrows enter from the left edge; two hit a chartreuse-filled box with a small ink label, while the third ends in an empty area with no target.
Two out of three visits can be traced back to their source. The third is missing a referrer and ends up in Direct.

In short, the built-in solution only partially covers you. For a complete picture, you also need a custom channel group.

Step 1: Check what GA4 already captures

Go to Reports, then Acquisition, then Traffic acquisition. Set the primary dimension to "Session default channel group". If you've had AI traffic since the built-in channel was launched, "AI Assistant" will appear as a separate row.

This gives you a starting point, but remember that it doesn't include Perplexity, and it doesn't include sessions that have lost their referrer information.

Step 2: Build a custom GA4 channel group for AI traffic

Go to Admin, then Data Settings, then Channel Groups. Create a new custom channel group.

Add a rule based on the session source, using a regular expression that captures the domains of the major AI tools. Something along these lines is a good starting point:

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

This captures Perplexity, which the built-in channel doesn't cover, in addition to giving you an independent check on the others.

Step 3: Capture what GA4 files as Direct

This is harder to solve completely, but you can mitigate the problem.

If you have the opportunity, request that links shared through your own channels or partners always use UTM parameters.

For your own part, if you have content you know is being cited by AI tools, you can't force referrer information from the outside. However, you can use a hidden form field on contact forms and landing pages that asks “how did you find us?”, and then manually map the answers to AI sources afterwards. It's not elegant, but it gives you a point of comparison against what GA4 reports automatically.

Flat illustration: two ink arrows enter from the top-left edge into an outlined frame where the upper bar is filled chartreuse and the lower one is only outlined, with the label GA4 beside it.
The point of the setup: AI traffic gets its own line instead of disappearing into Direct.

Step 4: Build a custom exploration report in GA4

Go to Explore, and create a new free-form report. Add the dimensions Session source, Session medium, Landing page, Country, and Device category. Add the metrics Sessions, Engaged sessions, Conversions, and Revenue.

Apply a filter to include only sessions where the source matches openai, chatgpt, gemini, perplexity, or copilot. Save the report. This will become your fixed overview of how your AI traffic is actually performing, regardless of how it's categorised in the standard reports.

Step 5: Check the server logs GA4 never sees

What's described above captures humans who click through from an AI answer to your site. It doesn't capture anything that happens when the model itself fetches information from your site to answer a question, without any human clicking anything.

It doesn't show up in Google Analytics at all. It appears as bot traffic in your raw server logs, under user agents like OAI-SearchBot, Claude-SearchBot, PerplexityBot, and similar ones. These build the index the model actually searches in when someone asks a question, and are therefore closer to the citation pipeline than anything GA4 can show you.

Check if your hosting provider gives you access to raw server logs. A simple filter on these user-agent strings will tell you if and how often these bots are visiting your pages. It still doesn't guarantee you'll be cited in an actual answer, only that your page is part of the candidate set. If you're in control of your robots.txt and llms.txt, this is also where you'll see if your rules are actually being respected.

What the GA4 setup does not solve

Be honest with yourself that none of this gives you a complete picture. Even with all this in place, a significant portion of actual AI traffic will remain invisible to you, simply because referrer information doesn't exist for a large percentage of sessions. This is, as many have pointed out, an industry-wide measurement challenge with no perfect solution in 2026.

The goal of the setup above isn't perfect measurement. It's to go from measuring nothing to measuring something.

That gives you a consistent basis for comparison over time, even if the absolute number will always be an underestimate.

If you want the full picture, specifically how AI models search and select sources in the first place, and what that means for your priorities, you can read part 1 of this series. And if the GA4 setup above isn't enough and you're considering buying a dedicated visibility tool as well, I've written part 4, a separate review of the most common tools on the market, including my own experiences with them.

Anabel — grunnlegger av SmåSeo

Need help with the setup?

I'll set up AI traffic tracking for you

I'm happy to help get the tracking in place, or to interpret the numbers once they're there. If you just have a question about AI and search, send it over anyway, and I'll dig into it.

  • Channel group and report: A custom AI channel group placed correctly in the sequence, and a fixed exploration report you can follow over time
  • The logs as well: I'll check if your hosting provider gives you access to raw server logs, and set up filtering for AI bots
  • Honest caveats: You'll know what the setup doesn't capture, so you don't read the numbers as more precise than they are
  • Free first look: Run a free SEO and GEO analysis of your website in under a minute, [start here](/seo-analyse)

Free tool

Check your own page in under 30 seconds

Technical SEO check + AI evaluation of how visible the page is to LLMs and AI Overviews.

Anabel Hafstad

I can help too — Anabel

Further reading (for the especially interested)

Sources used in this article

GA4 mechanics directly from Google:

  • Google Analytics Help, Default channel group, primary source for how Direct and Unassigned are actually defined

AI traffic and Direct/dark traffic:

  • Roar Digital, How to track AI referral traffic in Google Analytics, with further reference to a Clickport analysis of 446,000 sessions (April 2026)
  • Digital Applied, GA4's New AI Assistant Channel: Measure AI Traffic in 2026
  • AuthorityTech, ChatGPT Just Shipped Its Own Not Provided
  • The Digital Bloom, Gen AI Website Traffic Share Report (February 2026)
  • Bulldog Digital Media, What Is Dark Traffic? Why Your AI Traffic Is Lying To You
  • The GEO Community, Why GA4 Undercounts AI Search Traffic: Dark Traffic Explained
  • Conversios, How to Track AI Referral Traffic from ChatGPT in GA4 (2026 Guide)
  • DarwinApps, How to Track ChatGPT, Gemini and Perplexity Referral Traffic in GA4 and CRM
  • nadiamohamed.me, Track AI Referral Traffic in GA4: 2026 Guide

AI crawlers and server logs:

  • OnCrawl, What AI bots are really doing on your site
  • Contently, AI Crawlers Explained: GPTBot, ClaudeBot, and PerplexityBot
  • Anagram, AI Crawlers Explained: GPTBot, ClaudeBot, PerplexityBot and How to Let Them In (2026)
  • geotoolbox.ai, AI Crawlers: The List of AI Bots & How to Control Them
  • DataImpulse, Robots.txt & AI Crawlers in 2026: The Full Guide
  • SoRank, AI Crawlers: How GPTBot, ClaudeBot, and PerplexityBot Read Your Site in 2026

This is a rapidly changing field. GA4's own features for AI traffic are less than six months old at the time of writing, so be sure to check Google's own documentation for the very latest before you set up anything permanent. The specific range of 35 to 70 per cent comes from several secondary sources that themselves cite a single analysis (Clickport, April 2026). The mechanism itself, that "Direct" occurs when the source and medium are explicitly empty, is, however, verified directly against Google's own documentation.

Ofte stilte spørsmål

  • Partially. Google added a dedicated AI Assistant channel in GA4 in May 2026, which captures visits from ChatGPT, Gemini, Copilot, DeepSeek, and Grok, among others. Perplexity is not on that list and still ends up in regular Referral.