How to Track Traffic From AI Overviews (Step-by-Step Guide for GA4 & GTM)

how to track traffic from ai overviews

AI Overviews are changing how users discover content on Google. Instead of clicking traditional blue links, users now often interact with AI-generated answers that cite sources directly inside the search result. When they do click, the behavior is different, and most analytics setups are not ready for it.

That’s why many websites are already getting traffic from AI Overviews without realizing it.

By default, Google Analytics does not clearly show which visits come from AI Overviews. These clicks often use text fragment URLs like #:~:text=, which standard analytics tools ignore. As a result, AI-driven visits are mixed into regular organic traffic, making it impossible to measure their true impact on engagement, conversions, or revenue.

If you want to understand how much traffic AI Overviews actually send to your site, which pages benefit the most, and how this traffic performs compared to normal search, you need to set up fragment-aware tracking.

This guide walks you through how to track traffic from AI Overviews properly using GA4 and Google Tag Manager, so AI-driven discovery becomes a measurable channel instead of a blind spot in your data.

What Makes AI Overview Traffic Different

A typical click from an AI Overview looks like this:

https://example.com/article#:~:text=some%20highlighted%20text

Everything after #:~:text= is a text fragment. Browsers use it to jump directly to the relevant passage on the page. However, standard analytics tools strip this fragment when recording pageviews.

As a result, GA4 only records:

https://example.com/article

You still see a page visit, but you have no way to tell whether that visit came from a traditional organic result or from an AI Overview citation.

Why Tracking Text Fragment Traffic Matters

Tracking AI Overview traffic allows you to answer questions that third-party SERP tools cannot answer on their own:

How many users are actually clicking from AI Overviews?
Which pages and topics generate AI snippet visibility?
Do AI-driven visits convert better or worse than standard organic traffic?

Without fragment tracking, AI traffic blends into generic organic sessions. With it, you gain a clear signal that gives you a real optimization advantage instead of relying on assumptions.

How to Track AI Overview Fragment Clicks in GA4 Using GTM

Because GA4 does not automatically capture URL fragments, you need Google Tag Manager to read and send that data manually. GTM can access the fragment portion of the URL and pass it to GA4 as a custom event or parameter.

Step 1: Enable Built-In GTM Variables

In Google Tag Manager, go to Variables and click Configure under Built-In Variables. Enable the following:

  • Page URL
  • Page Path + Query
  • New History Fragment

These variables allow GTM to detect changes in the fragment portion of the URL.

Step 2: Create a Custom JavaScript Variable for the Fragment

Next, create a variable that extracts the fragment itself.

  • In GTM, go to Variables and click New.
  • Choose Custom JavaScript.
  • Name it something like JS – URL Fragment.
  • Paste the following code:
function() {
return window.location.hash || undefined;
}

This captures the full fragment, including #:~:text=, so it can be sent to GA4.

Step 3: Create a Fragment-Based Trigger

AI Overview clicks often change the fragment without triggering a full page reload. To handle this, use a History Change trigger.

  • In GTM, go to Triggers and click New.
  • Choose Trigger Type: History Change.
  • Set the condition to:

New History Fragment does not equal undefined

This ensures the trigger only fires when a fragment exists.

Step 4: Send the Event to GA4

Now connect everything to GA4.

  • Create a new Tag in GTM.
  • Choose Google Analytics: GA4 Event.
  • Enter your GA4 Measurement ID.
  • Set the Event Name to something like ai_overview_click.

Add an Event Parameter:

  • fragment_text → {{JS – URL Fragment}}

Attach the History Change trigger you created earlier, then publish your GTM container.

At this point, GA4 will receive a custom event whenever a user lands on your site via a fragment-based link.

Step 5: Register a Custom Dimension in GA4

To make the fragment usable in reports, register it as a custom dimension.

  • In GA4, go to Admin → Custom Definitions → Create Custom Dimension.
  • Name it AI Overview Fragment.
  • Set Scope to Event.
  • Set Event Parameter to fragment_text.

Once processed, you can segment and analyze AI Overview traffic separately from standard organic visits.

How to Verify and Test Your Setup

  • Use GA4 DebugView to confirm events are firing correctly.
  • Click on AI Overview links that include #:~:text= and watch for the custom event.
  • Compare fragment events with total pageviews to understand AI traffic share.

Testing is critical here, since fragment behavior depends on browser handling and timing.

Using Third-Party Tools Alongside Analytics

SEO platforms help you understand where AI Overviews appear, even though they cannot show actual clicks.

  • Semrush highlights AI-related SERP features.
  • Ahrefs shows queries and pages associated with AI visibility.
  • Rank Ranger or AccuRanker offer limited AI feature tracking.

Use these tools to identify opportunity. Use GA4 and GTM to measure actual engagement.

Why GA4 Cannot Track This by Default

URL fragments are never sent to servers. GA4 only sees what the server receives, which is why fragment data is invisible unless captured client-side.

This is similar to Single Page Applications, where navigation happens without page reloads. Without history or fragment listeners, analytics sees only one pageview even though multiple interactions occur.

AI Overview traffic behaves the same way.

Best Practices for AI Overview Traffic Tracking

  • Use UTM parameters where you control the link destination.
  • Combine fragment tracking with page-level metadata for deeper analysis.
  • Segment AI traffic separately from standard organic sessions.
  • Regularly audit your GTM setup as GA4 configurations evolve.

Final Thoughts

Tracking traffic from AI Overviews is no longer optional. As AI-driven search becomes a core discovery channel, relying on default analytics setups creates serious blind spots in how performance is measured and evaluated.

Because text fragments like #:~:text= are ignored by default, accurate tracking requires a properly configured Google Tag Manager setup that listens to history and fragment changes. When this data is combined with third-party SEO tools, brands can finally connect AI visibility with real user behavior, not just impressions or theoretical exposure.

At MediaPlus Malaysia, our SEO Service is built around measurement-first thinking. Rankings and traffic volume matter, but only when they can be tied back to engagement, conversion, and business impact. That is why our SEO frameworks are designed to capture performance across traditional organic search, AI Overviews, and other evolving SERP features.

In parallel, our GEO Service focuses on optimizing how brands are discovered, cited, and referenced within AI-generated search experiences. GEO goes beyond classic SEO signals by aligning content structure, entity clarity, and topical authority with how large language models surface and recommend information.

If your analytics do not show traffic from AI Overviews today, the issue is rarely demand. It is almost always measurement. With the right tracking architecture and a strategy that combines SEO and GEO, AI-driven search stops being a black box and becomes a measurable, optimizable growth channel. When visibility and attribution work together, SEO decisions become clearer, more defensible, and far easier to scale.

Share it :

Is Your Brand Invisible to AI? Find Out Now.

Grab your free AI Visibility Audit to see if AI engines are recommending your services. 100% free, zero obligations.