GA4 Site Search – Tracking Site Search in Google Analytics 4

In this article, I am going to talk about setting up site search tracking in Google Analytics 4.

Through GA4 site search feature you can determine the search terms used by your website visitors to find information on your website.

With the release of Google Analytics 4 property (GA4) in October 2020, by enabling enhanced measurement in GA4 you can automatically track and measure interactions and content on your sites in addition to standard page views.

Site search is also automatically tracked in GA4 property. Each time a user performs a site search, indicated by the presence of a URL query parameter an event is generated in GA4. You can see these events in real-time as below.

Site search events provide insight into the different user queries that users are looking at on the website. It also gives details about the results displayed to them.

By default, GA4 tracks the ‘view_search_results’ event when a user inputs a query and then click on the search button. As the event gets fired on the website, Google also sends a few default parameters such as search_term, page_location, and source. You can see these parameters in real-time.

Let’s set up site search tracking and understand it more.

Get the E-Book (50 Pages)

Get the FREE E-Book (50+ Pages)

GA4 Site search setup

Even though Site search setup is preconfigured in a GA4 property, if you want to know where the settings are configured you can follow the below steps.

Step 1: Navigate to Your GA4 Property in Google Analytics. Click on the ‘Admin’ tab available in the left-hand side reporting menu.

Step 2: A new overlay will appear, as below. Click on ‘Data Streams’.

Step 3: Data streams shows you all the available streams (GA4 properties and their details). Select the stream on which you want to set up site search tracking.

Step 4: An overlay will appear, like below, showing data stream details. It also shows details of enhanced measurement, which automatically tracks page views, scrolls, outbound clicks, file download, and site search. Click on the ‘Gear’ icon.

Step 5: Another overlay will appear like below, where you can see site search option is set to ‘Enabled’, like below.

If by any chance site search is not enabled, click on the toggle switch to turn it ‘On’.

Congratulations, you have successfully set up site search for Google Analytics 4!

Site search is automatically tracked, but it will only work on default query parameters defined by Google. A search query parameter is the part of the URL which comes after the ‘?’ character.

By default, the search event is triggered based on the presence of one of the following five parameters in the URL:

  1. q
  2. s
  3. search
  4. query
  5. keyword

If your website uses any other parameter, other than a default parameter, in its URL, you can additionally configure a custom parameter to fire the event.

Configuration custom search query parameter

Step 6: Click on ‘Show advanced settings’ under the ‘Site search’ option in ‘Enhanced Measurement’.

Step 7: An advanced settings panel will open up like below. In the ‘Additional Query Parameters’ text box type your custom query parameter that reflects in URL when someone searches. For example, I am using ‘searchid’ as the custom parameter.

Step 8: Click on ‘Save’ in the upper right corner of the overlay.

You are all set now. Head on to your website and perform any search query and you will see the search event firing in GA4 property in real-time.

Real-time debug

You can check in real-time for all the search events happening. To debug site search event tracking in real-time, follow below steps.

Step 1: Navigate to your GA4 property and click on ‘Realtime’ from the ‘Reporting’ menu.

Step 2: Now open a new tab in Chrome and navigate to your website. Once your website’s page has loaded completely, switch back to the earlier GA4 Chrome tab and you can see real-time events, like below.

Step 3: Now navigate to your website and perform any search query in the search box available. Let’s say I am searching for ‘Digital Marketing Blog’. Type the query in the search box and click on the search icon.

Step 4: You can now see the new page is being loaded, along with the search query parameter ‘searchid’ and our search text in the URL.

Step 5: Now switch back to your GA4 Chrome tab and check if the event is firing in real-time or not. As you can see from the below image ‘view_search_results’ is fired.

If you can see the ‘view_search_results’ event on the list, you have successfully set up the site search tracking.

Checking event parameters for site search events

Step 6: Now click on ‘All Events’ from the ‘Reporting’ menu on the left-hand side of the GA4 Chrome tab.

Step 7: You will see the event list as below. Click on the ‘view_search_results’ event.

Step 8: You will see in the ‘Reporting’ panel, a section with the title ‘Events in last 30 minutes’.

Step 9: You will also see ‘Parameter name’ drop-down where you can find additional parameters. Click on the drop-down menu and you will get the list of parameters available along with events, as below.

Step 10: Select the parameter you want to see. For example, let’s select ‘search_term’.

Step 11: As you can see from the below image, the parameter value is ‘digital marketing blog’ for the parameter name ‘search_term’.

Step 12: If you want to check where this search was performed you can select ‘page_location’ parameter from the drop-down. Click on the drop-down again and select ‘page_location’.

Step 13: Once you select the page location parameter it will provide you with the details on where the search query was performed, as below.

So, that is how you can check events parameters for site search events.

Conclusion

Site search functionality provided by a website is widely used by users who are searching for information or products.

In order to know more about what type of queries users’ perform on the website, it always recommended to set up site search.

With a Google Analytics 4 property, you get site search tracking implemented by default. If by any chance it’s not enabled you can enable it through the ‘Enhanced Measurement’ option available for site search.

You can also configure your own search query parameter and fire the events.

In the Events report, in the GA4 ‘Reporting’ menu, you can also get more details on different event parameters when the search happens on the website.

Other articles related to GA4 (Google Analytics 4)

#1 GA4 Intro

  1. What is GA4 (Google Analytics 4) – The Apps + Web Property?
  2. Key Benefits of Using Google Analytics 4 (GA4)
  3. How to upgrade to GA4 (Google Analytics 4)
  4. Google Analytics 4 (GA4) vs Universal Analytics – What is the difference?
  5. Google Signals GA4 – See demographics (gender, age) in Google Analytics 4
  6. Understanding Google Analytics Measurement ID (GA4)
  7. Google Analytics 4 training and tutorial
  8. Using the GA4 test property

#2 GA4 Integration

  1. How to connect GA4 (Google Analytics 4) with Google Data Studio
  2. How to link GA4 (Google Analytics 4) with Google Ads
  3. GA4 BigQuery – Connect Google Analytics 4 with BigQuery

#3 GA4 Events

  1. GA4 (Google Analytics 4) Event Tracking Setup Tutorial
  2. How to set up GA4 Custom Events via Google Tag Manager
  3. GA4 (Google Analytics 4) Enhanced Measurement Tracking Tutorial
  4. Events Report in Google Analytics 4 (GA4)
  5. GA4 User Properties (User Scoped Custom Dimensions) – Tutorial
  6. Event Scoped Custom Dimensions in GA4 – Tutorial

#4 GA4 Conversions

  1. GA4 (Google Analytics 4) Conversion Tracking Guide
  2. How to import conversions from GA4 property to your Google Ads account

#5 GA4 Dimensions and Metrics

  1. GA4 Metrics Tutorial with Free Google Analytics 4 Ebook
  2. GA4 Custom Metrics Tutorial
  3. GA4 Dimensions Tutorial
  4. GA4 Custom Dimensions Tutorial

#6 GA4 Ecommerce

  1. GA4 (Google Analytics 4) Ecommerce Tracking via GTM – Tutorial

#7 GA4 Specialized Tracking

  1. Cross Domain Tracking in GA4 (Google Analytics 4) Setup Guide
  2. GA4 Site Search – Tracking Site Search in Google Analytics 4
  3. GA4 (Google Analytics 4) Scroll Tracking Tutorial
  4. How to Install Google Analytics 4 on Shopify
  5. Self-referral Google Analytics 4 – Referral exclusion GA4
  6. GA4 Data Import Tutorial

#8 GA4 filters

  1. GA4 filters – Understanding data filters in Google Analytics 4
  2. How to create and test filters in Google Analytics 4 (GA4)?
  3. Exclude internal traffic in GA4 (Google Analytics 4) via IP filter

#9 GA4 Analysis Hub

  1. Analysis Hub Google Analytics – Exploration Report in GA4 (Google Analytics 4)
  2. How to use the user lifetime report in Google Analytics 4 (GA4)
  3. How to use path analysis report in Google Analytics 4 (GA4)
  4. How to use Segment Overlap Report in Google Analytics 4 (GA4)
  5. How to use the Funnel Analysis Report in Google Analytics 4 (GA4)

#10 GA4 Advanced

  1. How to use Debug View report in Google Analytics 4 (GA4)
  2. Understanding GA4 measurement protocol
  3. How to create a remarketing audience in Google Analytics 4 (GA4)
  4. GA4 Audiences – Creating custom audience in Google Analytics 4
  5. How to build comparison (Advanced segment) in Google Analytics 4 (GA4)

#11 GA4 Reporting

  1. How to create custom insights in Google Analytics 4 (GA4)

Register for the FREE TRAINING...

"How to use Digital Analytics to generate floods of new Sales and Customers without spending years figuring everything out on your own."



Here’s what we’re going to cover in this training…

#1 Why digital analytics is the key to online business success.

​#2 The number 1 reason why most marketers are not able to scale their advertising and maximize sales.

#3 Why Google and Facebook ads don’t work for most businesses & how to make them work.

#4 ​Why you won’t get any competitive advantage in the marketplace just by knowing Google Analytics.

#5 The number 1 reason why conversion optimization is not working for your business.

#6 How to advertise on any marketing platform for FREE with an unlimited budget.

​#7 How to learn and master digital analytics and conversion optimization in record time.



   

My best selling books on Digital Analytics and Conversion Optimization

Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.

Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.

Attribution Modelling in Google Analytics and Beyond
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.

Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.

About the Author

Himanshu Sharma

  • Founder, OptimizeSmart.com
  • Over 15 years of experience in digital analytics and marketing
  • Author of four best-selling books on digital analytics and conversion optimization
  • Nominated for Digital Analytics Association Awards for Excellence
  • Runs one of the most popular blogs in the world on digital analytics
  • Consultant to countless small and big businesses over the decade
error: Alert: Content is protected !!