Quantcast
Viewing latest article 1
Browse Latest Browse All 128

Complete Tutorial on Tracking Site Search in GA4

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.

Image may be NSFW.
Clik here to view.
ManoMano - Site Search

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

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.

  1. Demystify great keywords for SEO
  2. Demystify great keywords for PPC
  3. Discover ideas for expanding your product assortment
  4. Optimize site search performance
  5. 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.

Image may be NSFW.
Clik here to view.
Site Search - sunglasses for children
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.

Image may be NSFW.
Clik here to view.
GA4 - Site Search 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:

Image may be NSFW.
Clik here to view.
GA4 - site search query parameter
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.

Image may be NSFW.
Clik here to view.
GA4 -debugView - site search term

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).

Image may be NSFW.
Clik here to view.
GA4 - amazon.com site search query parameter
Step 3: go to your GA4 property (Admin section).

Image may be NSFW.
Clik here to view.
GA4 - property admin section

Step 4: click on the ‘Data Stream’ in the ‘Property’ column where you want to implement site search tracking.

Image may be NSFW.
Clik here to view.
GA4 - Data Stream selection

Step 5: if not yet done, enable Enhanced Measurement.

Image may be NSFW.
Clik here to view.
GA4 - enable Enhanced measurement

Step 6: click on the ‘gear’ icon under the toggle, enable site search and ‘show advanced settings’.

Image may be NSFW.
Clik here to view.
GA4 - enable site search and show advanced settings

Step 7: review the list of the query parameters that are captured by default.

Image may be NSFW.
Clik here to view.
GA4 - site search default query parameters

Step 8: add ‘k’ to the ‘Search Term Query Parameter’ field as it is not captured automatically.

Image may be NSFW.
Clik here to view.
GA4 - 'k' site search

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.

Image may be NSFW.
Clik here to view.
GA4 - 'k' and 'ref' site search

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.

Image may be NSFW.
Clik here to view.
GA4 - Custom Definitions

Step 2: click on ‘Create custom dimensions’ button.

Image may be NSFW.
Clik here to view.
GA4 - Create custom dimensions button

Step 3: create a new custom dimension (event-scoped).

Image may be NSFW.
Clik here to view.
GA4 - search_term custom dimension

Step 4: double check if everything is set up correctly.

Image may be NSFW.
Clik here to view.
GA4 - review search_term parameter

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.”

Image may be NSFW.
Clik here to view.
GA4 - 'search_term' general Google

How to Report on GA4 Site Search

In the GA4 UI there are several ways on how you can report on this data:

  1. View the ‘Events’ report in the default reporting UI.
  2. Create a free-from report in the ‘Explore’ section of GA4.
  3. 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.

Image may be NSFW.
Clik here to view.
GA4 - Events report

Step 2: search for the ‘view_search_results’ event and click on the link.

Image may be NSFW.
Clik here to view.
GA4 - 'view_search_results' link click

Step 3: find the ‘search_term’ custom parameter card.

Image may be NSFW.
Clik here to view.
GA4 - 'search_term' custom parameter

  • 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).

Image may be NSFW.
Clik here to view.
GA4 - explore (Blank - create new)

Step 2: name your report ‘Site Search Terms’.

Image may be NSFW.
Clik here to view.
GA4 - Explore - Site Search Terms

Step 3: add ‘Search term’ to this free-form report.

Image may be NSFW.
Clik here to view.
GA4 - add dimension 'search term'

Step 4: add ‘Event name’ to the selection.

Image may be NSFW.
Clik here to view.
GA4 - explore - event name
Step 5: click on the ‘Import’ button in the top right corner.

Image may be NSFW.
Clik here to view.
GA4 - import both dimensions in Explore

Step 6: you will see both dimensions on the left now.

Image may be NSFW.
Clik here to view.
GA4 - both dimensions are imported (Explore)

Step 7: repeat the same steps, but now for the metrics ‘Event count’ and ‘Event count per user’.

Image may be NSFW.
Clik here to view.
GA4 - explore - event count + event count per user

Step 8: add ‘Search term’ and both metrics to the report (to do this: double click on each element).

Image may be NSFW.
Clik here to view.
GA4 - explore - empty row

Step 9: add a filter on the ‘view_search_results’ event to remove the empty row.

Image may be NSFW.
Clik here to view.
GA4 - filter - 'view_search_results'

Step 10: review the data in the new report.

Image may be NSFW.
Clik here to view.
GA4 - explore - search term 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.

Image may be NSFW.
Clik here to view.
GA4 - site search effectiveness (GA3)

Step 2: make a note of the requirements for this report in GA4.

Two segments

#1 – Segment that includes all site search sessions

Image may be NSFW.
Clik here to view.
GA4 - segment - site search sessions

#2 – Segment that excludes all site search sessions

Image may be NSFW.
Clik here to view.
GA4 - segment - non-site search sessions

Six metrics

  1. Sessions
  2. Transactions
  3. Ecommerce revenue
  4. Average purchase revenue
  5. Session conversion rate
  6. 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

Image may be NSFW.
Clik here to view.
GA4 - add segments to GA4 Explore
Add metrics to free-form report

Image may be NSFW.
Clik here to view.
GA4 - add metrics to GA4 Explore
Step 4: review the data in the new report.

Image may be NSFW.
Clik here to view.
GA4 - site search in GA4 effectiveness

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

Image may be NSFW.
Clik here to view.
GA4 - Reporting Identity = device based

  • 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.

Get Free Access to The Google Analytics 4 Audit Tool

The post Complete Tutorial on Tracking Site Search in GA4 appeared first on Online Metrics.


Viewing latest article 1
Browse Latest Browse All 128

Trending Articles