What site search data can tell you
Search data answers questions no other report can, because the visitor supplies the words.
- Demand the site does not meet. Searches that return nothing are visitors who said what they wanted and were told the site did not have it. Some are products the business does not stock; others are products it stocks under another name.
- Vocabulary the site does not use. Misspellings, plurals, synonyms and series or model names show how customers describe things, which is often not how the catalogue or the navigation does.
- Navigation that fails. Searches for things the menu already offers, such as delivery, returns or a main category, suggest people could not find them by browsing.
- Search quality. Searches that end the visit or are immediately refined show results that did not help, even when there were results.
The conversion research methods guide treats analytics as the part of research that is precise about what happened and silent about why. Search terms are the exception, because they carry intent in the visitor's own words, which is why they repay a regular review.
Before you start
- Explorations, understood. The Explorations tutorial covers the free-form, path and segment techniques this tutorial uses, and the samplingWhen an analytics tool calculates a report from a subset of the data and scales the result up, rather than processing every event. indicator to check before reading a result.
- The event schema. The events and parameters guide explains event parameters, custom definitions and why an unregistered parameter does not appear in reports.
- Access. Editor rights on the property to change the stream's search settings and register custom definitions, and publish rights on the Tag Manager container if the search event will be sent from the Data LayerA structured object on a web page that passes values to a tag manager for tags to use..
- A developer contact who knows how the site's search works: whether the query appears in the results page address, and whether the results template knows how many results it returned.
- The BigQuery export, if it is linked, for the exits and refinements step. The BigQuery export basics guide covers the link; the export starts from the day it was linked, so link it now if a later step will need it.
Confirm how the site records a search
Run a search on the site and look at the results page address. If the query appears as a parameter, the enhanced measurement site search option can record it: the events guide lists
view_search_resultsamong the enhanced measurement events, and the GA4 setup tutorial explains that the option depends on the site's query parameterA key and value appended to a URL after a question mark, such as a filter, sort order, session or tracking tag, that may or may not change the page. name being in the configured list, so check the stream's settings and add the name if it is missing. If the address does not change, because the search runs inside the page or in an overlay, enhanced measurement cannot see it. In that case the site should push a search event to the data layer when results are shown, carrying the term, and a Tag Manager tag sends it as a GA4 event; the events guide listssearchamong the recommended events. Write down which route the site uses, the event name and the parameter that carries the term.Check the query arrives in DebugView
With Tag Manager preview running, open DebugView and run several searches: a normal term, a term with capitals and extra spaces, a misspelling, a term with no results and a term containing a symbol. For each, click the search event in the timeline and confirm the term arrives as an Event ParameterA named value sent with an analytics event that describes it, such as a page location, form name or item price., spelled as typed, and that one search produces one search event. Two events for one search usually mean the enhanced measurement option and a data layer tag are both active; switch one off. Note the exact name of the parameter carrying the term, because the remaining steps refer to it.
Make the query reportable
Open a free-form exploration and look for the term in the dimension list. If no available dimension shows it, register the term parameter as an event-scoped Custom DimensionA GA4 reporting field created by registering an event, user or item parameter so it appears in reports and explorations. under custom definitions; the events guide notes that registration is not retroactive, so the report fills from the day it is created. Search terms take many distinct values, and the events guide warns that standard reports collapse the long tail of such dimensions into an "(other)" rowThe number of distinct values a dimension or field holds; high-cardinality dimensions, such as page paths with IDs, can exceed report row limits., which is one reason this analysis lives in Explorations and the export. Normalise where you can. For searches sent through the data layer, lower-case and trim the term and collapse repeated spaces in the push, so that variants group together. For the enhanced measurement route the term arrives as typed, so normalise in analysis, as the export query below does.
Add a results count for zero-result searches
The search event says what was asked, not what was found. Ask the developer to expose the number of results the template returned, and send it as a second parameter with the search. Enhanced measurement sends its own parameters, so the usual route is to send the search event from the data layer with both the term and the count, and to switch off the enhanced measurement search option so that searches are not counted twice. Register the count as an event-scoped custom dimension, because its job is to filter: the value that matters is zero. If counts vary widely, also send a parameter that only says whether there were results and register that instead. Check both in DebugView with a search that finds nothing.
Build a search terms exploration
Create a free-form exploration named for the question, with the date range inside the property's retention. Put the term dimension in rows, and event count and total users in values, filtered to the search event. Sort by event count. Add a second tab with the same layout and a filter for a results count of zero: this is the zero-result report the e-commerce conversion hub calls the first one to read. Add a third with device category as a column, because mobile and desktop searches can fail in different ways. Check the sampling indicator on each tab, note on the exploration whether the figures were sampled, and export the tables for the theming step.
Compare searchers with non-searchers
Build two session segments: sessions that include the search event, and sessions that do not. Apply both as comparisons to a free-form tab with key events, session key event rate and revenue as values, broken down by device. The CVRShare of visits or clicks that convert. of each group, which the conversion rate calculator reproduces from the counts, shows how valuable searchers are. It does not show what search adds, because people who search often arrive knowing what they want. The more useful SegmentationDividing a market or customer list into groups that need different offers or messages. is within searchers: sessions whose searches all found results against sessions with at least one zero-result search. That gap is the cost of failing searches. The segment overlap technique answers a related question, how many searchers reached checkout.
Find searches that end the visit or are refined
A path exploration starting from the search event, with page titles or event names as nodes, shows what people did next: a product page, another search, a category. Another search straight after the first is a refinement, the visitor trying again in different words. Visits that end on the results page are clearer in the export, where every page view in the session can be ordered. The query below, for sites whose results page address carries the query, lists each term with the number of results page views, how many were the last page of the visit and how many were followed by a different search. Set
@query_paramto the parameter name from the first step.WITH views AS ( SELECT user_pseudo_id, (SELECT value.int_value FROM UNNEST(event_params) WHERE key = 'ga_session_id') AS session_id, event_timestamp, (SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'page_location') AS page_location FROM `project.dataset.events_*` WHERE _TABLE_SUFFIX BETWEEN @start_date AND @end_date AND event_name = 'page_view' ), terms AS ( SELECT *, LOWER(TRIM(REPLACE(REPLACE(REGEXP_EXTRACT(page_location, CONCAT('[?&]', @query_param, '=([^&#]*)')), '+', ' '), '%20', ' '))) AS term FROM views ), sequenced AS ( SELECT *, LEAD(page_location) OVER (PARTITION BY user_pseudo_id, session_id ORDER BY event_timestamp) AS next_page, LEAD(term) OVER (PARTITION BY user_pseudo_id, session_id ORDER BY event_timestamp) AS next_term FROM terms ) SELECT term, COUNT(*) AS results_views, COUNTIF(next_page IS NULL) AS ended_visit, COUNTIF(next_term IS NOT NULL AND next_term != term) AS refined FROM sequenced WHERE term IS NOT NULL AND term != '' GROUP BY term ORDER BY results_views DESCFor searches sent from the data layer, apply the same ordering to the search event and the page views that follow it.
Group terms into themes
Individual terms are too many to act on; themes are a work list. Export the terms with their searches, zero-result counts, exits and refinements into a spreadsheet, and assign each frequent term to a theme: product or category names, brands or authors, series or model names, misspellings and plurals, synonyms the catalogue does not use, codes and references, service questions such as delivery and returns, and products the business does not sell. For each theme, total the searches and work out its share of zero-result searches and of exits. The themes with the most failing searches are the first fixes; a theme of products the business does not sell is a buying question, not a search fix, and goes to whoever owns the range.
Fix the top themes and measure again
Each theme has its own fix. Synonyms map the customer's word to the catalogue's. Spelling tolerance or explicit corrections handle frequent misspellings. Searches for a category, a service page or a series can be sent straight to the right page. Service questions need the answer findable from search and from the menu. Ranking and merchandising changes belong to the e-commerce conversion hub. Record each fix in the measurement change log with the themes it targets, then rerun the same exploration tabs and export query for a comparable period afterwards and compare, theme by theme, the zero-result share, the exit share and the share of searching sessions that converted. Repeat the review monthly.
A month of searches, read (illustrative)
The example applies the steps to a small shop with a search log nobody had read.
Moonfeather Bookshop reads its zero-result searches
Moonfeather Bookshop is an invented independent online bookshop. Its search sends the query in the results page address, so enhanced measurement already recorded searches; the team adds a data layer search event with a results count and switches the enhanced measurement option off. In the first full month there are 9,400 searches, of which 1,320 (14%) return nothing. In the export, 58% of zero-result searches are the last page of the visit, against 21% of searches that found results.
| Theme (first month) | Zero-result searches | Fix |
|---|---|---|
| Series names | 410 | Synonyms mapping each series name to its books |
| Misspelt authors | 380 | Corrections for the 40 most misspelt author names |
| Gift cards and delivery | 150 | Searches sent straight to the gift card and delivery pages |
| Formats and ISBNs | 120 | ISBN search enabled; format words added as synonyms |
| Everything else | 260 | Reviewed monthly |
The next month has 9,250 searches and 610 zero-result searches (6.6%). Zero-result searches for series names fall to 60 and for authors to 90, the exit share of searches in those two themes falls from 61% to 27%, and orders from sessions with a series-name search rise from 18 to 71. Searching sessions still convert at 6.8% against 2.3% for sessions without a search, a gap the shop no longer reads as the effect of search itself.
Search data and personal data
People type all sorts of things into search boxes, including their own email address, a phone number, an order reference or another person's name. The search term parameter carries whatever they typed into analytics and the BigQuery export, where everyone with access can read it. The guide to keeping personal data out of analytics lists site search as one of the routes and gives a sweep that finds such values.
The fix is redaction, not switching search off. For searches sent through the data layer, replace values that match agreed patterns (an at sign followed by a domain, long runs of digits, the format of the business's own order references) with a placeholder in the push or in a container variable before the event is sent. For the enhanced measurement route, the term comes from the page address, so the same patterns have to be handled where the page location is cleaned. Add the search term to the fields the regular sweep checks, and never paste examples of found values into tickets or chats.
Common mistakes
- Assuming search is tracked. Enhanced measurement needs the right query parameter, and in-page searches need a data layer event; check before analysing an empty report.
- Counting each search twice. The enhanced measurement option and a data layer tag both active.
- No results count. Without it, zero-result searches, the most useful report, cannot be found.
- Reading terms in standard reports. The long tail collapses into "(other)"; use Explorations and the export.
- Crediting search with searchers' conversion rate. Searchers arrive with intent; compare failing and successful searches instead.
- Fixing terms one at a time. Themes turn a long list into a few fixes with measurable effects.
- Not measuring again. A fix without a before-and-after comparison is a guess.
- Turning search tracking off over personal data. Redact the patterns and keep the most direct record of customer intent the site has.
The GA4 hub lists the other guides on events, reports and Explorations that this tutorial builds on.
