Search Generative Experience (SGE), introduced by Google, blends AI-driven content into the search engine results pages (SERPs), providing users instant answers, summaries, and related information.
Tracking SGE performance is crucial to understanding how this new search experience affects traffic, rankings, and visibility. Tracking SGE also opens insights into leveraging AI Overviews for ranking keywords.
Using Google Analytics for Tracking SGE
Tracking SGE using GA4 involves tracking URL Fragments. The Fragment path for URLs on SGE results is appended with “#:~:text=“. This is similar to the fragments seen for Featured Snippets & People Also Ask – the scroll-to-text fragments.
The report may include traffic from sources like Featured snippets or People Also Ask as the URL Fragment is the same for all.
I recommend using tools like Semrush to figure out a Pareto on which SERP feature contributes to visibility to vet traffic reported in GA4
Sample GA4 Report for Tracking SGE
Step by Step Instruction on tracking SGE in GA4
1. Set Up Google Tag Manager (GTM)
Ensure you have GTM installed on your website and properly linked to your GA4 property.
2. Create a Custom JavaScript Variable in GTM
You would need a variable that captures the URL fragment.
- In GTM, go to Variables.
- Click New and choose Variable Configuration.
- Select Custom JavaScript.
- Enter the following code to create a variable that captures the URL fragment:
function()
{
return window.location.hash;
}
5. Name this variable, e.g., URL Fragment
.
3. Create a GA4 Event Tag in GTM
Set up a tag that sends the fragment data to GA4.
- Go to Tags and click New.
- Choose Tag Configuration and select GA4 Event.
- Configure your GA4 Event tag:
- Configuration Tag: Select your GA4 configuration tag.
- Event Name: Enter an appropriate event name, like
fragment_view
. - Event Parameters: Add a parameter to capture the fragment.
- Parameter Name:
url_fragment
- Value: Choose the
URL Fragment
variable you created earlier.
- Value: Choose the
- Parameter Name:
- Set up a trigger for this tag:
- Click Triggering and select Page View.
- Click the plus icon to create a new trigger.
- Name the trigger, e.g.,
All Page Views
. - Choose Page View as the trigger type.
4. Configure GTM to Capture Fragment Changes
By default, GTM only captures the initial page load. To track fragment changes, you need an additional setup.
- Go to Triggers and click New.
- Choose Trigger Configuration and select History Change.
- Name this trigger, e.g.,
Fragment Change
. - Set up the trigger with the following configuration:
- Enable this trigger when all of these conditions are true: Select
Page URL
matches.*
(using Regex).
- Enable this trigger when all of these conditions are true: Select
- Save the trigger.
5. Link the Fragment Change Trigger to Your GA4 Event Tag
Ensure the event tag also fires on fragment changes.
- Go back to the GA4 event tag you created.
- Under Triggering, add the
Fragment Change
trigger.
6. Publish Your GTM Container
After setting up the tags and triggers, publish the changes in GTM.
7. Verify Data in GA4
Check GA4 to ensure the event with the URL fragment parameter is being captured correctly.
- Go to your GA4 property.
- Navigate to Events and look for the
fragment_view
event. - Check the event parameters to see if
url_fragment
is being recorded.
Using Semrush to Track AI Overviews
You can use third-party tools like Semrush to track AI Overviews snippets. The only limitation here is you won’t be able to track traffic accurately. The traffic metric in the report doesn’t match with GA4 numbers.
The Position Tracking tool in Semrush can monitor a website’s visibility within AI Overviews.
1. Go to Projects on the left side of the Semrush console
2. Now Scroll to the left and click on Create Projects to add domain and target keywords
3. Once the Project is setup, click on the overview tab in the Position Tracking tool
4. Filter AI Overviews in the SERP features filter
5. The keywords report will be filtered for visibility performance for AI Overviews.
A Detailed Guide on Tracking AI Overviews
Subscribe to Our Newsletter!
The combination of using GA4 and Semrush is a great strategy. I was able to analyse the impact of SGE effectively with your guide. Thank you!