GA4 Tip: Site search in GA4 vs UA

Chris Vu
Sparkline
Published in
3 min readApr 13, 2023

--

Photo by Marten Newhall on Unsplash

Universal Analytics (UA) Site Search tracking

UA has different hit types including Page View, Event Tracking, and Transaction.

Note that:

  • Site search tracking in UA is based on Page View hit
  • User’s search term is extracted from a URL parameter of the recorded Page dimension. For example: www.mywebsite.com/search?q=shipping%20cost where “q” is the URL parameter and “shipping cost” is the search term.

In other words, in UA it is assumed that a site search = a page load

This makes it tricky for UA to track modern web applications such as dynamically loaded search results. For example:

UA does have powerful reports for site search where you can not only look at users’ search terms but also the page flows:

The names can be confusing but what they mean:

  • Start Page = The pages where the search was conducted. For example, entering a search term on the search box on the homepage. Homepage = Start Page
  • Destination Page = The search results pages
  • Search Destination Page = The next page views right after the “Destination Page” page view. Basically this infers the search result click-through destination pages

Google Analytics 4 (GA4) Site Search tracking

In GA4, site search is a completely different event from the page_view event

To track site search, you record an event where:

You can either do this manually (good for tackling dynamic search results) or automatically on page load via Enhanced measurement in the web data stream settings:

Note: Enhanced measurement site search works based on web page load, NOT page_view event. In other words, unlike UA, GA4 site search is decoupled from the page view.

At the time of this writing, GA4 doesn’t have a powerful reporting tool to see the page flows. If you want to do similar reports to what UA has, you would have to do it via BigQuery.

Sparkline aims to provide data accuracy, comprehension and consolidation, and most importantly, tangible insights for businesses. Get in touch if you’d like to find out more about GA4.

--

--

Chris Vu
Sparkline

How did my life bring me to this point being a technical consultant in digital analytics and optimization, I have no idea…