Tracking visitor intent can reveal many hidden optimization opportunities. In this blogpost you will learn why and how to track site search in GA4 for greater insights!
There are multiple ways on how users find your content or products. In some cases they immediately find what they are looking for, i.e. through SEO or PPC.
But, very often they arrive on your website and use the main navigation or internal site search functionality to narrow down before they exactly find what they need.
Site search can come in many flavors, but this search box is always implemented to facilitate the user in finding what she needs.
At the end of this post you will know in great detail how to implement and report on site search in Google Analytics 4.
Table of Contents
- Five Reasons to Track Site Search
- Site Search Tracking Requirements
- Site Search Tracking Event
- How to Implement Site Search Tracking
- How to Report on GA4 Site Search
- Why Some Site Search Terms Might be Missing
- Concluding Thoughts
Ok, let’s dive right in!
Five Reasons to Track Site Search
There are many reasons why tracking site search in Google Analytics 4 is key for any website with a site search feature.
Here are five reasons why you need to track site search in GA4.
- Demystify great keywords for SEO
- Demystify great keywords for PPC
- Discover ideas for expanding your product assortment
- Optimize site search performance
- Optimize your website UX
#1 Demystify Great Keywords for SEO
Do you stumble upon many site search keywords or phrases you are not targeting via SEO? And even better, do they facilitate conversions on your website?
If yes, consider adding these keywords and long tail variations to:
- Your SEO content strategy
- Keyword focused and search query solving content pages
- Elements of your navigation structure
#2 Demystify Great Keywords for PPC
New keywords are relevant to add to your SEO strategy, but what about PPC? In many cases, using a combined keyword strategy can be fruitful.
Setting up a short targeted PPC campaign is very helpful for determining the actual value of keywords for your business.
#3 Discover New Product Ideas
Here is a specialized sunglasses company in the US: Costa Del Mar.
Their navigation bar shows the ‘Men’ and ‘Women’ categories.
But, what if many users search for ‘sunglasses for children’?
This is a potential opportunity for developing (smaller) sunglasses, specifically for children. And changing the navigation structure accordingly.
#4 Optimize Site Search Performance
In general, users who use the site search functionality tend to perform (convert) better. This is mainly because they are closer to the bottom of the conversion (purchase) funnel.
Setting up site search tracking in GA4 will support you in finding out about the performance of site search users vs non-site search users.
Embedding specific A/B tests can be beneficial to find out more here.
#5 Optimize Your Website UX
I recommend having a closer look at the popular search terms for your business and connected search result pages. Is there a high exit percentage on (any of) these pages?
Try to optimize the search result pages at least for the most popular queries. And even better, optimize the site search as a whole.
Very often a high number ‘no results pages’ indicates that there is something wrong:
- User intent and search queries are not in line with your website and content pages
- You site search functionality is lacking
Are you convinced site search tracking is valuable for your business?
Site Search Tracking Requirements
It is a requirement to have a site search feature on your website or app to get site search in GA4 to work.
In most cases, Google Analytics 4 is able to automatically track site search activity via Enhanced Measurement.
You can use Enhanced Measurement for tracking site searches in GA4 if:
- You have a site search feature on your website
- The site search keyword or phrase is exposed in the URL via a query parameter
This is what the second definition is referring to:
The site search query parameter is the part of the URL that comes after ‘?’:
- Query parameter -> q=site+search
- Search term -> q=site+search
Two alternative scenarios:
- Site search feature is available on your website, but the query parameter is not exposed in the URL -> you need to leverage GTM to send the site search data to GA4.
- Query parameter is not exposed in the URL and GTM doesn’t do the trick -> work with your developer to either 1) expose the query parameter in the URL or 2) push the search term to the data layer every time a visitor completes a search.
Note: for the purpose of this article, we don’t further explore these two scenarios, but focus on the most common scenario and implementation instead.
Site Search Tracking Event
Site search in GA4 tracks by default the ‘view_search_results‘ event (if enabled via Enhanced Measurement, which we will discuss in a bit).
You can use the ‘debugView’ to see this in real-time or simply use GA4 real-time.
Several parameters are captured in addition to the ‘view_search_results‘ event:
- search_term -> actual search term exposed via the URL query parameter
- unique_search_term -> not documented by Google, but it shows a ‘1’ if this is the first search on this particular term
- page_location -> full page URL
And a few more parameters that provide context to the site search data you are capturing are visible here.
How to Implement Site Search Tracking
The process of setting up site search tracking in GA4 is quite straightforward.
I have divided the setup in two parts.
Part 1: Enhanced Measurement
Step 1: navigate to the website for which you want to implement site search tracking in Google Analytics 4 (i.e. Amazon.com).
Step 2: use the site search feature on the website and make a note on the query parameter in the URL (‘k’ for Amazon.com).
Step 3: go to your GA4 property (Admin section).
Step 4: click on the ‘Data Stream’ in the ‘Property’ column where you want to implement site search tracking.
Step 5: if not yet done, enable Enhanced Measurement.
Step 6: click on the ‘gear’ icon under the toggle, enable site search and ‘show advanced settings’.
Step 7: review the list of the query parameters that are captured by default.
Step 8: add ‘k’ to the ‘Search Term Query Parameter’ field as it is not captured automatically.
Step 9: decide if you need to add additional query parameters.
Here is the Amazon.com URL:
- s?k=ga4&crid=363AXH4RRK9IT&sprefix=ga%2Caps%2C191&ref=nb_sb_noss_2
In this case we assume that ‘ref’ is providing extra context for site search and we want to integrate it in our tracking.
In general, defining additional query parameters can be useful when users can filter and further narrow down on the site search results.
Step 10: save all changes before closing the screen.
Part 2: Custom Dimension
You need to register a custom dimension in order to use the ‘search_term’ parameter properly in the GA4 UI and Explore section (not required for BigQuery analysis).
I will use a test property here (no custom dimensions implemented yet).
Step 1: click on ‘Custom definitions’ under the GA4 property.
Step 2: click on ‘Create custom dimensions’ button.
Step 3: create a new custom dimension (event-scoped).
Step 4: double check if everything is set up correctly.
Step 5: review if all data is collected properly.
We will explore this topic in more detail in the next section.
Last note:
“Google is continuously updating the list of parameters that are automatically available for further analysis (without registering). It seems now the ‘Search term’ is also added, which is great news as you might be able to save one slot here. You can freely use it in the Explore section, but still need to register it if you want to use it as a secondary dimension.”
How to Report on GA4 Site Search
In the GA4 UI there are several ways on how you can report on this data:
- View the ‘Events’ report in the default reporting UI.
- Create a free-from report in the ‘Explore’ section of GA4.
- Bonus: replicate the aggregated Site Search effectiveness report of GA3/UA.
#1 Events report in GA4 default reporting UI
There are a few steps you need to take to review this data.
Step 1: navigate to ‘Reports’ and open the ‘Events’ report.
Step 2: search for the ‘view_search_results’ event and click on the link.
Step 3: find the ‘search_term’ custom parameter card.
- This is where you can get basic information about the top search terms. It is not an ideal overview.
- Please note that Google Analytics has applied thresholding to this card and will only display the data when the data meets the minimum aggregation thresholds.
- You need to register ‘search_term’ as a custom dimension to see this card here.
#2 Explore Report in GA4
I recommend using the Explore section of GA4 when you want to evaluate site search performance in GA4.
Step 1: navigate to the ‘Explore’ section and click on ‘Blank’ (Create a new exploration).
Step 2: name your report ‘Site Search Terms’.
Step 3: add ‘Search term’ to this free-form report.
Step 4: add ‘Event name’ to the selection.
Step 5: click on the ‘Import’ button in the top right corner.
Step 6: you will see both dimensions on the left now.
Step 7: repeat the same steps, but now for the metrics ‘Event count’ and ‘Event count per user’.
Step 8: add ‘Search term’ and both metrics to the report (to do this: double click on each element).
Step 9: add a filter on the ‘view_search_results’ event to remove the empty row.
Step 10: review the data in the new report.
In the next chapter I will explain why the Site Search terms list might not be complete here.
As promised, here is the bonus section that explains a more in-depth analysis of site search (based on aggregation of all search terms).
#3 Site Search Effectiveness in GA4
This is a bit more complex, but it will yield greater insights from a commercial insights perspective.
Step 1: review the site search conversion report in GA3.
Step 2: make a note of the requirements for this report in GA4.
Two segments
#1 – Segment that includes all site search sessions
#2 – Segment that excludes all site search sessions
Six metrics
- Sessions
- Transactions
- Ecommerce revenue
- Average purchase revenue
- Session conversion rate
- Per session value
You could work with ‘ARPU’ as ‘per session value’ is not available in GA4.
I haven’t used it as the site search report in GA4 is session-scoped.
Step 3: create the required report in GA4.
Add segments to free-form report
Add metrics to free-form report
Step 4: review the data in the new report.
Last note: be mindful about the ‘session conversion rate’ as in addition it might include other conversions than ‘purchase’.
Why Your Report Doesn’t Show All Site Search Terms
The number one reason why some dimension values are hidden (i.e. in the Site Search Terms report) is because thresholding is applied if you enable Google Signals.
How to avoid thresholding in GA4
- Don’t enable Google Signals if you are not interested in using Demographic reports and you don’t plan using GA4 Audiences for Remarketing via Google Ads.
- There is no 100% solution if you need one or both of these features – there is a workaround though.
Workaround to show all Site Search terms in GA4
- In most cases, iIf you use ‘Observed’ or ‘Blended’ reporting identity, thresholding is applied (and you don’t see dimension values with low values).
- But, switching to Device-based will remove thresholding AND Google will not use Google Signals to calculate users.
The set up of reporting identity is flexible and you can change the setup as many times as you want.
- The data stored is not affected and reporting identity is applied retroactively.
- Also, keep in mind that when you use device-based, the User ID calculations are not take into account (if implemented). This results in less accurate user counts.
Again, reporting identity does not affect the data collection, so data is only temporarily hidden or changed based on the reporting identity that you choose.
Be mindful when changing this setting as it affects the reporting experience of all users that have access to the related GA4 property.
Concluding Thoughts
Tracking site search in GA4 is straightforward (in most cases) because of the Enhanced Measurement integration.
However, reporting on it and make a conversion analysis can be tricky. You need to know how to explore your data outside of the default GA4 UI.
In this blogpost you have learned how to effectively use the default GA4 reporting UI as well as the ‘Explore’ section for analyzing site search performance.
In addition, think about the possibilities of analyzing site search data via an integration with Looker Studio and/or BigQuery. There are endless possibilities if you have the required skillset to dive deeper.
This is it from my side. Please let me know your thoughts and suggestions in the comments!
One last thing... Make sure to get my automated Google Analytics 4 Audit Tool. It contains 30 key health checks on the GA4 Setup.
Michal says
Hi, thanks for the article, very useful.
Any ideas how to recreate other site search reports from UA?
E.g. Search Pages (with dimensions Start page, Destination Page, Search Destination Page)., or % Search Exits ?
Thanks,
Michal
Paul Koks says
Hi, unfortunately you won’t be able to replicate the exact report(s) yet. The related metrics and dimensions are not available in GA4. You can learn something about Search Exits by using Path Explorations and Funnels in the Explore section of GA4, but the insights are limited currently.
Jamie Kim says
Hi Paul! We see the unique_search_term parameter in the debug view but we don’t see it as a dimension in explorer. Do you know how we can see or add this parameter in explorer? Thank you!
Paul Koks says
Hey Jamie, did you try to register it as a custom dimension first? There are some issues with this parameter as in many cases it is coming in as (not set). Another option would be to explore the parameter values via a BigQuery integration.
Ian Haynes says
Useful post – thanks. In my UA account, I can easily see the search terms list and associated revenue against each search term. However, I am struggling to get a similar report in GA4. I can see search terms in GA4 and total users & event amount – but i can’t get a revenue column with any data against each search term.
Any ideas?
Paul Koks says
Hi Ian,
As described in the post, you can analyze your search terms (aggregated performance via segmentation, i.e. in Explore), but at the individual search term level it becomes more challenging.
1) You can create a segment analyzing the revenue of one particular search term or a group of search terms. Doing this for all different search terms is impossible unless you automate the analysis (i.e. via a Supermetrics integration and using smart formulas).
2) Just a thought, if it is technically possible for you to ‘store’ the search term and include it in the purchase event as a parameter, you would be able to make an analysis at the search term level more easily. Haven’t tried it on my end though, but it can work I believe.
Una says
Hi Paul,
This is really helpful, except, my Search term column is empty – what am I doing wrong?
Paul Koks says
Not sure, are you tracking the Search terms correctly?