How to Track Traffic From AI Overviews (SEO & GTM Guide)

how to track traffic from ai overviews

With the rise of AI-generated search results like AI Overviews (also called AI Snippets), it’s often unclear how much traffic these new placements actually send to your site. Traditional analytics tools were built for regular search clicks, not AI-driven discovery so GA4 and other analytics platforms won’t count these sessions automatically unless you configure tracking for them.

A common pattern when users click from an AI Overview is that Google adds a URL fragment (e.g., #:~:text=...) to the link to highlight relevant text on your page. That fragment itself does not get tracked by default by Google Analytics, because fragments are client-side only and not sent to servers automatically.

This guide helps you set up tracking for these URLs so you can see how much traffic you’re getting from AI Overview links and similar fragments.

What Makes AI Overview Traffic Special?

A typical click from an AI Overview might look like:

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

The part after #:~:text= is a text fragment used by browsers to scroll to or highlight that section but standard analytics tools strip fragment parts when recording pageviews.

Without fragment-aware tracking, your analytics will only show:

https://example.com/article

That means you know someone visited the page, but you cannot tell whether the visit came from a normal search listing or an AI Overview link.

Why You Need to Track Text Fragment Traffic

Understanding AI Overview traffic helps you answer questions that third-party SERP tools cannot:

  • How many users click from AI Overviews?

  • Which queries and pages generate AI snippet placements?

  • How well do these visits convert compared to regular search?

Tracking them gives you a competitive edge in optimisation without artificial traffic gaps.

How to Track AI Overview Fragment Clicks in Google Analytics (GA4) via GTM

Since GA4 doesn’t automatically track fragments, you must capture them with Google Tag Manager (GTM). GTM’s URL Variable can read URL fragments, and then you can send that information to GA4 as a custom event or parameter.

Step 1: Enable GTM Built-In Variables

  1. In Google Tag Manager, go to Variables.

  2. Click Configure (Built-In Variables).

  3. Enable:

    • Page URL

    • Page Path + Query

    • New History Fragment
      These give you access to the part after # in the URL.

Step 2: Create a Custom URL Fragment Variable

You want to extract the specific text fragment (without the rest of the page path):

  1. In GTM → Variables → New

  2. Select Custom JavaScript

  3. Name it something like JS – URL Fragment

  4. Paste this code:

function() {
return window.location.hash || undefined;
}

This grabs the full fragment (e.g., #:~:text=...) so you can use it in tags.

Step 3: Create a Trigger for Fragment-Based Pageviews

  1. In GTM → Triggers → New

  2. Select Trigger Type: History Change

    • This fires when the URL fragment changes without a full reload (common for AI snippet clicks).

  3. Set conditions like:

    • New History Fragment does not equal undefined
      This ensures the trigger only fires when a fragment exists.

Step 4: Send a GTM Event to GA4

Now that you can detect fragments, send them to GA4:

  1. In GTM → Tags → New

  2. Choose Google Analytics: GA4 Event

  3. Set your GA4 Measurement ID

  4. Event Name: e.g., ai_overview_click

  5. Add Event Parameters:

    • fragment_text{{JS – URL Fragment}}

  6. Under Triggering, add your History Change Fragment Trigger created above.

  7. Publish your GTM container.

This tells GA4: “Record a custom event with the text fragment value whenever a fragment is present.”

Step 5: Create Custom Dimensions in GA4

To use this fragment text in analytics reports:

  1. In GA4, go to Admin → Custom Definitions → Create Custom Dimension

  2. Name it AI Overview Fragment

  3. Scope: Event

  4. Event parameter: fragment_text

Now you can segment reports by this dimension.

Tips for Verification and Testing

  • Use GA4 DebugView to test events in real time.

  • Click on sample AI Overview links that include #:~:text= and ensure your event fires.

  • Compare fragment events with regular pageviews to see proportion of AI-driven clicks.

Tracking AI Overview Traffic With Third-Party Tools

Third-party SEO and SERP tracking tools help identify which queries trigger AI Overviews and whether your site appears in them:

Tool What It Tracks
Semrush SERP feature presence, including AI snippets
Ahrefs Query rankings and SERP features
Rank Ranger / AccuRanker Some platforms include AI feature tracking

These tools won’t tell you actual clicks, but they provide visibility into where your content is shown in AI Overviews.

Why Standard Analytics Won’t Show It Without Setup

By design, URL fragments (the part after the #) are not sent to servers, and therefore platforms like GA4 won’t count them unless you explicitly capture them via GTM or client-side logic.

This is similar to how Single-Page Apps handle navigation normal analytics sees only one page load, not each fragment interaction and why you must use history or fragment listeners in GTM to track these reliably.

Best Practices for AI Overview Traffic Tracking

  1. Use UTM parameters when possible for links you control so analytics tools attribute sessions precisely.

  2. Combine fragment tracking with page metadata to know which pages and content generate AI clicks.

  3. Segment traffic in reports e.g., AI traffic vs organic search vs other channels.

  4. Regularly audit your GTM setup updated GA4 configurations and events help keep tracking accurate.

Final Thoughts

Tracking traffic from AI Overviews and fragment-based links is no longer optional. As AI-driven search becomes a core part of how users discover content, relying on default analytics setups will leave major blind spots in your data.

Because URL fragments like #:~:text= are not captured automatically, a properly configured Google Tag Manager setup using history and fragment triggers is essential to ensure accurate tracking. When combined with third-party SEO platforms, this approach allows you to connect AI visibility with real engagement and conversions, instead of guessing performance based on impressions alone.

At MediaPlus Singapore, our SEO service goes beyond rankings and traffic volume. We help brands implement clean, reliable tracking frameworks so performance can be measured correctly across traditional search, AI Overviews, and emerging discovery surfaces. For businesses navigating the shift toward AI-powered search, our AI SEO service focuses on both visibility and attribution ensuring that traffic from AI features is not only earned, but also measured and optimized.

If your analytics currently fail to reflect traffic from AI Overviews or other new referral patterns, the issue is rarely demand. It’s measurement. With the right tracking architecture in place, AI search becomes a measurable growth channel rather than a black box and your SEO strategy becomes far more accurate, defensible, and scalable.

You Might Also Like

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.