Through the GA4 site search tracking feature, you can determine the search terms used by your website visitors to find information on your website:
What is the advantage of implementing site search tracking in GA4?
Once you have implemented site search tracking in your GA4 property, you can see the list of keywords (called ‘Search terms’) used by your website visitors to find information on your website:
This insight can help you in finding new content development opportunities.
Let us suppose you discovered that a lot of website visitors are searching for the keyword ‘enhanced ecommerce tracking’ on your website.
Let us also suppose that you do not have any article on ‘enhanced ecommerce tracking’ on your website.
In that case, you can publish a brand new article on ‘enhanced ecommerce tracking’ and can thus satisfy the website visitors’ query.
What is required in order to set up site search tracking in GA4?
If you do not have a site search feature (aka the search box, the internal search engine) installed on your website, then you won’t be able to benefit from the site search tracking feature in GA4.
So you need to have the site search feature on your website.
GA4 automatically tracks site searches (in most cases) once you have enabled Enhanced Measurement Tracking in your GA4 property:
However, there could be a situation in which the site search feature is installed on your website in such a way that the default site search tracking feature provided by GA4 won’t work for you.
In that case, you would need to use GTM (Google Tag Manager) to set up site search tracking in your GA4 property.
For example,
If you have the site search feature installed on your website, but the search term does not appear in the query parameter, then you won’t be able to benefit from the default site search tracking capability of GA4.
Here is what I meant by the search term appearing in the query parameter:
Here, the query parameter is the part of the URL which comes after the ‘?’ character.
So the query parameter is:
s=utm+parameters
Following is the search term used in the query parameter:
utm+parameters
If you have the site search feature installed on your website, but the search term does not appear in the query string, then you would have to use GTM to set up site search tracking on your website.
Alternatively, you can ask your web developer to configure the URLs of search result pages in such a way that it shows the search terms in the query string.
How does the site search tracking work in GA4?
By default, GA4 fires the ‘view_search_results’ event when a user inputs a query and clicks on the search button on your website.
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 in the GA4 Realtime report.
How to set up site search tracking in Google Analytics 4 (GA4)?
Follow the steps below:
Step-1: Navigate to the website for which you want to set up site search tracking in GA4.
Step-2: Use the search feature of your website by entering a search term in the search box:
Step-3: Note down the search query parameter from the URL of the search result page:
Here ‘s’ is the search query parameter
Step-4: Navigate to your GA4 Property.
Step 5: Click on the ‘Admin’ link available in the left-hand side reporting menu:
Step-7: Click on ‘Data Streams’ under the ‘Property’ column:
Step-8: Click on the web data stream for which you want to set up site search tracking in GA4:
Step-9: Make sure that the ‘Enhanced Measurement’ featured is enabled:
Step-10: Click on the gear button under ‘Enhanced measurement’ to access the settings menu:
Step-11: Make sure that the ‘Site Search’ feature is enabled:
Step-12: Click on the link ‘Show advanced settings’ under the ‘Site search’
You should now be able to see the advanced settings for the ‘site search’ feature:
Though site search is automatically tracked in GA4, it will only work on default query parameters defined by Google: q,s,search,query,keyword
If your website uses a search term query parameter which is not one of the default parameters supported by GA4, you would need to configure a custom parameter to fire the ‘view_search_results’ event.
For example, if your website uses the ‘st’ parameter in its URL to capture the search term:
https://www.optimizesmart.com/?st=utm+parameters
then you should enter the ‘st’ parameter in the text box below ‘Search Term Query Parameter’:
If you want to collect values from additional URL query parameters when the ‘view_search_results’ event occurs, then you should add the query parameters in the text box under ‘Additional Query Parameters’:
For example, the search URL below contains an additional query parameter called ‘title’:
Now, if you want to collect values from the ‘title’ query parameter when the ‘view_search_results’ event occurs, then you should add the ‘title’ parameter in the text box under ‘Additional Query Parameters’:
Additional query parameters are useful when your website search functionality allows users to filter search results using multiple filters.
Step-13: Click on ‘Save’ in the upper right corner of the overlay to save the advanced site search settings:
Step-14: Click on ‘Custom definitions‘ under the ‘Property‘ column in the GA4 admin area:
Step-16: Enter ‘search_term’ as the dimension name:
Step-17: Type‘search_term’ in the text box under the event parameter and then click on the ‘save’ button:
You will now see the ‘search_term’ listed as a custom dimension:
When you register an event parameter (like ‘search_term’) as a custom dimension, you see a new data card added to various event reports in GA4 once the parameter is logged (recorded):
Step-3: Use the search feature of your website by entering a search term in the search box:
You should now see the search result page:
Step-4: Click on the ‘DebugView’ report under the ‘Property’ column in the GA4 admin area:
Step-5: Set your debug device to ‘Google’ as we are using Google Analytics Debugger Chrome extension:
Step-6: Wait for a minute or so, scroll down and then find and click on the event ‘view_search_results’:
Step-7: Scroll down and then click on the event parameter ‘search_term’:
You should now be able to see the keyword you used to find information on your website (in our case, the keyword is ‘utm parameters’:
Since you can see the ‘view_search_results’ event and its corresponding parameter, it means the site search tracking is working correctly on your website.
Where can I see the data related to site search terms in GA4?
There are two ways you can see the data related to site search terms in GA4:
Through the ‘Events’report
By creating an exploration report (recommended)
Finding site search terms data through the ‘Events’ report
Follow the steps below:
Step-1: Once you have set up site search tracking, wait for at least 24 hrs before you go to find site search terms data in your GA4 property.
Step-2: Navigate to Reports > Engagement > Events
Step-3: Type ‘search’ in the search box and then press the enter key:
Step-4: Click on the event name ‘view_search_results’:
You should now see the report for the event ‘view_search_results’:
Step-5: Scroll down the report until you see the data card named ‘SEARCH_TERM’:
This data card reports on the search terms in decreasing order of event count.
The data card has also got a scroll bar on the right to scroll down:
Finding site search terms data by creating an exploration report
Follow the steps below:
Step-1: Click on the ‘Explore’ link from the left-hand side navigation bar in your GA4 property:
Step-10: Search and select the following metrics one by one in the exact order as mentioned below and then click on the ‘Import‘ button:
event count
event count per user
You should now see all the imported metrics listed under the METRICS section:
Step-11: Double-click on the dimension ‘Search Term’ so that it is automatically added to the Rows section:
Note: When you double-click on the ‘Search Term’ dimension, you won’t see any change to the canvas on the right. But the dimension has been added to the canvas. Only when you start adding metrics to the canvas will you start seeing the dimension(s) added to the canvas.
Step-12: Double click on the following metrics one by one, starting from the very top, so that they are automatically added to the blank canvas on the right:
event count
event count per user
Step-13: Scroll all the way down under the ‘Tab Settings’ column until you see the section called ‘FILTERS’:
Step-14: Click on ‘Drop or select dimension or metric’:
Step-15: Click on the ‘Event Name’ dimension from the drop-down menu:
Step-16: Click on the ‘Select match type’ drop-down menu:
Step-17: Click on ‘exactly matches’:
Step-18: Click on the ‘enter expression’ text box:
Step-19: Type ‘view_search’ in the text box and then click on the first search result:
Step-20: Click on the ‘Apply’ button to apply your filter to the canvas on the right:
You should now see a screen like the one below:
That’s how you can see the site search terms data via the exploration report.
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
Learn and Master Google Analytics 4 (GA4) - 126 pages ebook
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
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.
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.
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.