GapCite
GapCite Blog ยท AI visibility basics

Track AI traffic in GA4, correctly

GA4 doesn't cleanly separate "ChatGPT sent someone" from generic direct traffic. Build the real filter expression below, and understand what GA4 quietly misses.

By Joe WangUpdated September 2026Real GA4 filter builder
The short version
  1. GA4 can show AI-assistant referrals, but only when the click actually carries a referrer, a real share arrive stripped, landing in "(direct)" instead.
  2. Pick your AI assistants below, get a ready-to-use GA4 filter expression for Session source / medium.
  3. A GA4 filter only counts clicks that happened. It can't tell you about mentions nobody clicked, or mentions that never happened at all.

Why "just check GA4" isn't quite enough

When someone clicks a link inside ChatGPT, Perplexity, or Gemini, their browser usually sends a referrer header identifying where the click came from, GA4 can pick this up as a real source like chatgpt.com / referral. The problem is "usually." Some AI apps, especially in-app browsers on mobile, strip the referrer before opening the link, the same behavior that's long made Facebook and Instagram app-traffic hard to track cleanly. That traffic doesn't disappear from GA4; it just lands in the generic (direct) / (none) bucket, indistinguishable from someone who typed your URL in directly.

That means a real GA4 filter for known AI referrer domains is useful, but it's a floor on your real AI traffic, not the whole number.

Build your filter

Pick which assistants you want to track, then copy the expression into a GA4 exploration or audience using the Session source / medium dimension with a matches regex condition.

ToolGA4 AI-traffic filter builder
All selected by default, uncheck any assistant you don't want included.

Your filter expression


    

How to use it in GA4

  1. Go to Explore (or Admin > Audiences for a saved segment).
  2. Add a new segment, and add the dimension Session source / medium.
  3. Set the condition to matches regex, then paste the expression above.
  4. Apply it alongside your normal reports to see AI-referred sessions on their own.

What to do about the traffic GA4 can't see

For links you actually control, your own comparison pages, directory listings, anywhere you can shape the URL, add real UTM parameters (utm_source=chatgpt or similar) so a click is unambiguous even if the referrer header gets stripped along the way. You can't add UTMs to a link an AI assistant generates on its own, but you can to anything you place where it might get cited.

And no GA4 filter, however well built, tells you about the mention that never got a click, or the buyer question where you weren't mentioned at all. That requires actually running the real questions against the engines, not just watching your own analytics for whoever showed up.

FAQ

Does GA4 track AI referral traffic by default?

Partially. GA4 will show chatgpt.com or perplexity.ai as a referral source if the click carries a normal referrer, but a real share of AI-assistant clicks arrive with no referrer at all, landing in GA4's generic "(direct)" bucket instead of being credited to AI.

Why does some AI traffic show up as (direct) in GA4?

Some AI apps and in-app browsers strip the referrer header before opening a link, the same way many mobile apps do. GA4 has no way to know where a (direct) session actually came from unless the link itself carries a UTM parameter.

Should I add UTM parameters to links I put in AI answers?

You can't control links AI assistants generate on their own, but you can control links you place where AI might cite them, a comparison page, a directory listing, your own site. Adding UTMs there gives you a real, unambiguous signal instead of hoping the referrer survives.

Is a GA4 filter enough to fully measure AI visibility?

No. It tells you AI traffic that already clicked through to your site, which is useful, but it can't tell you whether you were mentioned and not clicked, or not mentioned at all, for that you need to actually run the real buyer questions against the engines themselves.

Sources