Blog · AI
— AI··9 min read

How to Track AI-Driven Traffic in GA4 When Referral Data Is Missing

Joona Heinonen· Choco Media · Rovaniemi

One of the quieter problems in web analytics right now is that a growing share of your traffic has no visible origin. Choco Media tracks this closely for clients, and across accounts we see the same pattern: ai traffic in GA4 lands under “direct” or “unassigned” because AI assistants strip or never pass referrer headers. This post is a practical guide to finding, labelling, and estimating the traffic that ChatGPT, Perplexity, Gemini, and similar tools send your way.

This is relevant if you are running an SEO programme or any content strategy that targets AI-powered answer engines. You are probably already getting traffic from these sources. The question is whether your reporting reflects it — and whether you can act on the data.

We will walk through why the attribution breaks, the proxy signals that reveal AI-referred sessions, the UTM hygiene fixes that capture future traffic more reliably, and how to build a custom channel group in GA4 that surfaces the picture over time.

Why AI Traffic Shows Up as Direct in GA4

When a user clicks a link from a ChatGPT chat session, the browser may send no referrer header, or it sends a referrer that points to openai.com — which GA4 typically classifies as direct or filters into a catch-all bucket depending on your referral exclusion list. Perplexity and Gemini behave similarly. The mechanisms differ slightly by platform and browser, but the result is the same: the session looks like it started from nowhere.

This is not a GA4 bug or a new problem unique to AI. The same thing happens with some email clients, with secure-to-non-secure redirects, and with certain mobile apps that open links in embedded browsers. AI assistants have simply made the problem bigger and more commercially significant.

The upshot is that your “direct” channel in GA4 is likely a mixture of genuine direct visits, bookmarked sessions, and AI-referred clicks. Separating them requires a combination of technical fixes and analytical inference.

Checking What Referrer Data You Already Have

Before assuming all AI traffic is invisible, it is worth checking what referrer strings are actually arriving. In GA4, go to Explore → Freeform → set the dimension to “Session source” and include all sessions, not just named channels. Look for:

In client work we have found that Perplexity is the most consistently trackable source by referrer string. ChatGPT and Gemini are much harder to catch this way. But this check gives you a floor: at minimum, you can attribute the sessions where the referrer did come through.

Setting up a custom channel group for AI referrers

Once you have identified the referrer strings that do appear, create a custom channel group in GA4 (Admin → Data Display → Channel groups → Create new channel group). Add a rule that matches session source containing “perplexity.ai” or “openai.com” or “gemini.google.com”. Name it “AI Assistants”. This does not capture all AI traffic, but it separates what is detectable from your broader direct bucket and lets you track the trend over time.

The honest position on AI traffic attribution in 2026 is this: you cannot know the exact number. What you can do is narrow the range of plausible estimates and build a monitoring habit that improves as more referrer data becomes available.

UTM Hygiene: The One Fix That Actually Scales

The most reliable way to capture AI-driven traffic is to tag every link you control with UTM parameters before it enters an AI-accessible context. This means:

The limitation is obvious: you cannot tag links in organic search results, or in AI-generated answers where the system chooses your URL unprompted. UTM tagging closes the attribution gap on the traffic you sent into circulation yourself. It does nothing for traffic that arrives because an AI cited you without your involvement.

Standardising UTM values across your team

One common problem we see is inconsistent UTM naming: one person writes utm_source=chatgpt, another writes utm_source=ChatGPT, another writes utm_source=chat_gpt. GA4 treats these as three different sources. Agree on a naming convention, document it in your content operations wiki, and enforce it. The simplest system is lowercase, hyphen-separated, no brand names in source unless it is a paid placement you own.

Proxy Signals for Estimating Uncaptured AI Traffic

For the traffic you cannot tag or track by referrer, you rely on inference. These are the signals we use in combination to build an estimate:

None of these signals is definitive in isolation. Together they let you build a range: “We estimate AI assistants drove somewhere between X and Y sessions last month, with Perplexity being the most attributable source at Z sessions.” That is good enough for strategy decisions even if it is imprecise as a metric.

Using GA4 Exploration Reports to Isolate Suspected AI Traffic

The GA4 Explorations workspace is more flexible than the standard reports for this kind of analysis. A setup that works well:

  1. Create a Freeform exploration with dimensions: Landing page, Session source/medium, Device category, and Date.
  2. Apply a filter: Session source exactly matches “(direct)” and Session medium exactly matches “(none)” — this isolates your hard-to-attribute direct sessions.
  3. Sort by Sessions descending to find the landing pages getting the most unattributed direct traffic.
  4. Cross-reference the top URLs against your published content and ask: are these pages appearing in AI answers? Test manually by asking ChatGPT, Perplexity, and Gemini questions related to each page’s topic.

This workflow will not give you exact numbers, but it identifies which specific pieces of content are most likely generating AI-referred traffic — which is actionable for content investment decisions.

Segment comparisons over time

Build two comparable date ranges in your exploration: before and after a piece of content started appearing in AI answers (you can estimate this from Search Console impression changes). Compare direct session volume to those landing pages in each period. A consistent lift that began around the time AI citations started appearing is reasonable evidence of attribution.

Server-Side Referrer Logging as a Longer-Term Fix

If you want more reliable data without depending on browser-passed referrers, consider logging referrer data server-side on your web server (nginx or Apache) or via a CDN like Cloudflare. This captures the referrer header as the request arrives at your server, before any browser-side JavaScript processing, which means you see what the browser actually sent rather than what GA4 decided to classify it as.

The logs will still show many direct visits with no referrer — the browser simply does not send the header in many AI-click scenarios. But you will sometimes capture referrers that GA4’s client-side tracking misses, particularly on fast-loading pages where the GA4 tag does not fire before the user navigates away. We cover the broader implementation in our post on attribution and server-side tracking in 2026.

Building a Monthly AI Traffic Report

Once you have these signals in place, a monthly review takes about 20 minutes. The format we use:

  1. Confirmed AI referrals — sessions from identifiable sources (perplexity.ai, any openai.com referrer that came through)
  2. Estimated unattributed AI traffic — range based on direct session analysis and branded search lift
  3. Top landing pages by AI attribution confidence — the 5-10 pages most likely driving AI-referred visits
  4. Month-over-month trend — are these numbers growing, stable, or declining?
  5. Content implications — which topics appear to be generating citations, and does that suggest we should publish more content in those clusters?

This is not a dashboard you can fully automate today because the estimation layer still requires judgement. But the data collection steps — GA4 exploration exports, Search Console API pulls, server log queries — are all automatable with a lightweight AI automation setup if you want to reduce the manual work.

What to Expect as AI Attribution Evolves

The current situation — where most AI-driven traffic is invisible — is unlikely to be permanent. A few developments to watch:

For now, the pragmatic approach is to combine what you can track reliably (tagged links, perplexity.ai referrers) with the proxy signals described above, review monthly, and document your estimation methodology so you can improve it over time rather than starting from scratch each quarter.

If you are working on an SEO and GEO programme and want to build a measurement setup that captures AI-driven growth accurately, we would be glad to talk through what makes sense for your site. The contact page is the easiest place to start.

← All storiesNext story →
— Free tips, monthly

Get the playbook, for free.

One short letter a month — the prompts we use, the campaigns that worked, the AI tools worth the time. No sales pitch, just field notes.

— Want us to do it for you?

Hire the agency.

AI-accelerated content, paid media, brand and web — delivered by one small team that talks to itself. Currently taking on a handful of clients each quarter.

Book a call