In this article, I will talk about setting up site search tracking in Google Analytics 4.
Through the 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 the 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 clicks on the search button. As the event gets fired on the website, Google 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.
Even though the site search setup is preconfigured in a GA4 property, you can follow the below steps if you want to know where the settings are configured.
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 show 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 the 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 URL part that 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:
q
s
search
query
keyword
If your website uses any parameter other than a default parameter in its URL, you can also 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 the 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 the 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 the 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.
You have successfully set up the site search tracking if you can see the ‘view_search_results’ event on the list.
Step 6: Now click on ‘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: In the ‘Reporting’ panel, you will see a section with the title ‘Events in last 30 minutes’.
Step 9: You will also see the ‘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 the ‘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 event parameters for site search events.
Conclusion
Site search functionality provided by a website is widely used by users searching for information or products.
To know more about what type of queries users perform on the website, setting up a site search is always recommended.
With a Google Analytics 4 property, you get site search tracking implemented by default. You can enable it through the ‘Enhanced Measurement’ option available for site search if it’s not enabled.
You can also configure your 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)
Frequently Asked Questions About GA4 Site Search Tracking
What is site search functionality in Google Analytics 4?
Site search is a functionality provided by a website in the form of a search box through which website visitors search the website for information or products. If your website provides site search functionality, you should set up ‘site search tracking’ in Google Analytics 4.
Through the GA4 site search feature, you can determine the search terms used by your website visitors to find information on your website.
How do I identify search query parameters?
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 parameter other than a default parameter in its URL, you can also configure a custom parameter to fire the event.
How to set up custom search query parameters?
To set up custom search query parameters, follow the below steps Step-1: Navigate to Admin Settings of your GA4 property Step-2: Click on Data Stream and select the data stream for which you want to set up a custom search query parameter Step-3: 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-4: Click on ‘Show advanced settings’ under the ‘Site search’ option in ‘Enhanced Measurement’. Step-5: In the ‘Additional Query Parameters’ text box, type your custom query parameter that reflects in the URL when someone searches. Step-6: Click on ‘Save’.
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 BeyondSECOND EDITION OUT NOW!
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 !!
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Allow Cookies”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
Cookie
Duration
Description
cookielawinfo-checkbox-analytics
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional
11 months
The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy
11 months
The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.