How to Track Traffic from AI Overviews, Featured Snippets, and People Also Ask (PAA) in GA4


Krunal Soni

Reviewed by Krunal Soni and Thrillax’s SEO experts, leveraging two decades of digital marketing know-how and cutting-edge AI tools.

If you’re in SEO or content marketing, here’s the hard truth: You might be getting traffic from AI Overviews, Featured Snippets, or People Also Ask results, and have no idea it’s happening.

Google Analytics 4 (GA4) doesn’t show you this, not out of the box.

So, how do you track it? How do you see if these special Google features are sending people to your site?

That’s exactly what we’ll break down here in this guide..

Understanding the Traffic Sources

Before setting up tracking, it helps to understand what these traffic sources are.

AI Overviews

AI Overviews are answers automatically created by Google’s artificial intelligence. They appear at the top of search results and summarize information from different websites.

Featured Snippets

Featured snippets are short answers Google shows at the top of search results. These often pull content from a webpage and show it in a highlighted box.

People Also Ask (PAA)

It is a box in Google search results that shows other questions related to what you searched for. And each answer includes a link to the website where the information came from.

How These Differ from Regular Search Results

Normally, when someone searches, they see a list of website links. But with Featured Snippets and AI Overviews, users get answers directly on Google’s page.

Limitations of GA4 with Search Traffic

Why GA4 Doesn’t Show This Information Automatically

GA4 shows general traffic sources (like “Google” or “Organic”), but it doesn’t tell you if the visitor came from a featured snippet, PAA, or AI Overview.

Why That’s a Problem

Because GA4 doesn’t know exactly where the visitor came from in Google search, you can’t easily tell how much traffic your Featured Snippets or AI Overviews are sending you. This means you might miss important insights.

Understanding the URL Structure

When someone clicks a featured snippet or AI Overview, the URL they land on may include a special pattern like :~:text=Some%20Text.

For example:

https://yourwebsite.com/article/:~:text=How%20to%20Track%20Traffic

This special part (:~: text=) means Google is linking directly to a highlighted piece of text on your page, usually from a Featured Snippet or AI Overview.

Important Notes:

  • Not every click from special search features includes this URL pattern.
  • These fragments don’t work with normal tracking methods like UTM tags.

Step 1: Set up JavaScript variables using Google Tag Manager.

This step helps Google Tag Manager (GTM) detect when a URL includes the :~:text= fragment and pull out the snippet text.

If you’re new to GTM, think of it as a tool that helps you send extra information to Google Analytics without changing your website code.

How to Do It:

1. Open your GTM account
2. Go to Variables > New

1

3. Choose “Variable Configuration” > “Custom JavaScript.”

2

4. Paste the below code:


function() {
  var entries = decodeURIComponent(performance.getEntries()[0].name.match(/:~:text=(.*)/)[1]);
  var frag = entries.replace(/%20/g, " ");
  var splitArray = frag.split(",");
  return splitArray[0];
}

5. Name the variable. We name it “JS–URL Start Snippet (AIO, Featured Snippet, Paa Tracking)” and click “Save”.

6. Repeat the same steps to create another variable for the Snippet End, using this code:


function() {
  var entries = decodeURIComponent(performance.getEntries()[0].name.match(/:~:text=(.*)/)[1]);
  var frag = entries.replace(/%20/g, " ");
  var splitArray = frag.split(",");
  return splitArray.slice(1).join(",");
}

7. Name the variable. We named it “JS–URL End Snippet (AIO, Featured Snippet, Paa Tracking)” and clicked “Save”.

3

Now, GTM is ready to collect snippet text if it appears in the URL.

Step 2: Send Snippet Text Data to Google Analytics 4

After capturing the snippet text in GTM, you need to send that data to GA4 so you can analyze it later.

There are two ways to do this:

Option 1: Add the Snippet to the Existing Page View Event

1. In GTM, go to “Tags” and open your GA4 Page View tag.

2. Scroll down to “Event Parameters”.

3. Add these two parameters:

  • snippet_text_start = {{JS–URL Start Snippet (AIO, Featured Snippet, PAA Tracking)}}
  • snippet_text_end = {{JS–URL End Snippet (AIO, Featured Snippet, PAA Tracking)}}

4

4. Save and publish your container.

Option 2: Create a New GA4 Event

1. In your Google Tag Manager account, go to the Triggers section and click “New”.

2. Set the Trigger Type to Page View.

3. In the “This trigger fires on” section, select “Some Page Views”.

4. Set this condition:

  • Variable: JS–URL Start Snippet (AIO, Featured Snippet, PAA Tracking)
  • Condition: does not equal
  • Value: undefined

5. Save it with whatever name you want. We used “Page View – URL snippet start exists”.

5

6. Now, create a new event tag.

7. Go to the Tags section, and click “New”.

8. Under Tag Configuration, select: Google Analytics > GA4 Event.

6

9. Enter your GA4 Measurement ID. To find it, go to GA4 > Admin > Data Streams > select your stream > Copy Measurement ID.

10. Set the Event Name to “snippet_text”.

11. Under Event Parameters, add two parameters:

  • Event parameter name: snippet_text_start
    Value: {{JS–URL Start Snippet (AIO, Featured Snippet, Paa Tracking)}}
  • Event parameter name: snippet_text_end
    Value: {{JS–URL End Snippet (AIO, Featured Snippet, Paa Tracking)}}

Note: Make sure to use the exact variable names that were defined in Step 1.

7

12. Name your tag, e.g., “GA4 – Snippet Tracking Event”

13. Click Save and Publish your changes.

If you want to keep things simple, Option 1 is easier and works well.

Step 3: Add Custom Dimensions in GA4

To use this data in GA4 reports, you need to define what the snippet values mean.

How to Do It:

1. Go to your GA4 property.

2. Click “Admin” in the lower-left corner.

3. Under “Data Display”, click “Custom Definitions”.

8

4. Click “Create Custom Dimension”.

9

5. Do this twice:

Custom Dimension 1:

  • Name: Snippet Start
  • Scope: Event
  • Event Parameter: snippet_text_start

Custom Dimension 2:

  • Name: Snippet End
  • Scope: Event
  • Event Parameter: snippet_text_end

6. Save both dimensions.

10

Step 4: Analyse the Data

Once everything is live, GA4 will start collecting snippet info.

Create Custom Reports (explore section)

  • Use “Snippet Start” or “Snippet End” as dimensions
  • Use metrics like Users, Sessions, or Conversions
  • Add filters for specific landing pages or content

Understand What’s Working

You can now:

  • See which snippets bring the most visitors
  • Measure how many users from snippets convert
  • Compare snippet traffic to regular search traffic

Build Custom Audiences

  • Create audiences based on users who arrived via snippets.
  • Use for remarketing, personalized content, or behavior insights.

Use Looker Studio

You can connect GA4 to Looker Studio (formerly Data Studio) and combine it with Google Search Console or SEO tools to visualize performance better.

Limitations

  • This method only works if the URL includes :~:text=.
  • Google may change how it generates or links AI Overviews and snippets.
  • It doesn’t show you the number of people who saw snippets, only those who clicked.

Final Thoughts

Monitor your SEO success in AI summaries and featured snippets.

We use this method on our sites. It’s helped us find out which pages Google is highlighting, and how that affects traffic.

If you’re also working with large language models (LLMs), take a look at What Is LLM SEO Optimisation?. You might also find our LLMs.txt SEO guide useful, it’s a smart way to signal to AI tools what content on your site should be used.

Start with just Step 1. It takes 15 minutes. Then let the data come in, and you’ll start to get insights.

You Can Read Our New Blog Below

Jun 4, 2025

How to Track Traffic from AI Overvi.....

Reviewed by Krunal Soni and Thrillax’s SEO experts, leveraging two decades of digit.....

Jun 2, 2025

How to Track AI Tools Traffic in GA.....

AI tools like ChatGPT, Perplexity, and Claude are changing how people find websites. .....

May 30, 2025

What Is LLM SEO Optimisation?

Search is no longer just about matching words. It’s about understanding what people.....