
Search Analytics: Instrumenting the Search Surface
Search fails silently, so nothing improves until the system writes the failure down. Here is the event set, the metrics worth keeping, and the log hygiene a search box demands.
TL;DR: Site search rots in the dark because its failures are silent — a user who finds nothing leaves without a trace unless the system wrote one. The instrumentation that fixes this is a small, specific event set with rank position on every click, four metrics that each name a decision they change, a standing review that routes findings to owners, and log hygiene for a text box people type their own names and order numbers into.
The neglect is a measurement failure first
Search is the feature that degrades without anyone filing a bug. A broken checkout produces support tickets. A search that returns nothing useful produces a user who closes the tab, and nothing else. Every other discipline within this topic — synonym curation, relevance tuning, zero-result recovery — depends on knowing that the failure happened and what it looked like, which makes instrumentation the precondition rather than a later refinement.
Five questions define what the event set exists to answer, and every event should earn its place by serving at least one of them. What do people search for. What do they find. What do they click. Where do they give up. Did the last change help. An event that answers none of these is a field someone will maintain forever without ever reading.
The bare-minimum starting point is a pageview on the results URL and nothing else. That answers the first question partially — you can recover queries from the URL if they are in it — and none of the other four. It cannot tell you whether the results were good, because a pageview is emitted identically for a perfect result set and an empty one.
One boundary belongs here in a sentence: search telemetry is product instrumentation of a single feature, and the tag-management and server-side collection infrastructure it rides on is a separate body of work with its own architecture and its own trade-offs.
The event set
The core events are few and their fields are the whole game.
{
"event": "search_submitted",
"query_raw": "wireless headphones",
"query_normalized": "wireless headphone",
"filters_active": { "category": ["audio"], "price_max": 200 },
"result_count": 47,
"search_session_id": "s_8f21c",
"sequence": 1
}{
"event": "result_clicked",
"document_id": "sku_44812",
"rank_position": 3,
"page": 1,
"search_session_id": "s_8f21c",
"sequence": 2
}Around those two sit the rest. A results-rendered event separates "the query ran" from "the user saw something," which matters when rendering can fail independently. A zero-result event carries which rung of the recovery ladder was reached and what the user did next, per the requirements the recovery surface defines. A suggestion-picked event carries the suggestion, its position in the dropdown, and how many keystrokes the user had typed when they picked it — the last of which shows whether the suggest surface is actually saving anyone effort. A facet-applied event records which filter moved. And a reformulation event links a follow-up query to the one it replaced, which is what turns a sequence of unrelated queries into a readable story about a user failing to find something.
Rank position on click events is the field to defend hardest. A click on rank one and a click on rank forty are opposite verdicts about ranking quality, and an event that records only which document was clicked collapses them into the same row. Click data without position is a weak input to relevance work: an eye-tracking study of web search concluded that clicks are informative but biased and "have to be interpreted relative to the order of presentation and relative to the other abstracts" (Joachims et al., SIGIR 2005). Without position, click data can tell you what is popular, which is precisely the thing ranking already made popular by putting it first.
Session linkage needs to work at the level of a visit: events ordered within one session so reformulation chains and search-then-exit are reconstructible. Identity resolution beyond the visit — tying this session to the same person on an earlier visit — is customer-data territory and is not needed for any of the five questions.
Treat the schema as versioned configuration reviewed like code. Renamed events and silently repurposed fields are how a year of baseline data quietly dies, and the death is only discovered when someone tries to compare one period against an earlier one.
Metrics that drive action
Zero-result rate is a cheap health signal, and a number that moves directly when synonyms or catalog gaps get fixed. Its usefulness depends on an honest denominator — bot traffic and gibberish filtered out per the recovery surface's triage — because unfiltered, crawler traffic can skew it away from user behavior.
Click-through by position answers two questions at once: whether users click results at all, and how far down they go to find one worth clicking. A top-heavy curve is what good ranking looks like, but it is not proof on its own: the same eye-tracking research on web search found a "trust bias" — more clicks on links ranked highly by Google, even if those abstracts were less relevant than other abstracts the user viewed (Joachims et al., SIGIR 2005). A flat curve across ten positions suggests ranking is not helping and users are scanning the page manually. Time-to-first-click supports the reading — a long delay before a click on rank two suggests the result was hard to judge from the card, which is a presentation problem rather than a ranking one.
Reformulation rate is the relevance smell: the first query did not satisfy, so the user tried again in different words. Search exit is the give-up signal. Both are direction-bearing rather than absolute — what matters is the shape and how it moves after a change, not a threshold copied from an industry blog post. Baymard Institute's e-commerce search research — usability testing of how users construct product search queries and navigate the results, plus a benchmark of leading US and European e-commerce sites — documents what typically goes wrong when users search e-commerce sites, and why (Baymard Institute, as of November 2026). That makes it useful background on the failures these events are meant to surface; the metric definitions here are this article's own. Engine-side logs can supplement these events: Elasticsearch, for example, documents a search slow log that records, per shard, query-phase and fetch-phase operations exceeding configured time thresholds. Search slow logs must be enabled separately for the shard's query and fetch search phases, and all thresholds default to -1, which disables slow logging, so the slow log is a threshold-based log of slow operations rather than a default record of every query (Elasticsearch slow log documentation, as of November 2026).
The honesty test for keeping any metric is simple: name the decision it changes. Total search volume does not pass — it goes up when traffic goes up and tells nobody to do anything. Average results per query does not pass either; a query returning four hundred results is not healthier than one returning twelve. Both decorate a dashboard, and both cost the same maintenance as a metric that earns its place.
| Metric movement | Likely cause | Routes to |
|---|---|---|
| Zero-result rate rising | Vocabulary gaps, catalog changes | Synonym dictionary, then content and catalog owners |
| Click curve flattening | Ranking not separating good from bad | Relevance configuration, gated by offline evaluation |
| Reformulation rate rising | First query under-served | Relevance work, or tolerance and synonym coverage |
| Suggestions shown but rarely picked | Suggest candidates weak or mis-ordered | The suggest surface and its candidate validation |
| Search exit rising with healthy counts | Results present but not persuasive | Result presentation: snippets, highlighting, cards |
| Zero-result rate flat after a synonym release | The change did not reach the fixable queries | Back to log triage — the hypothesis was wrong |
The loop and the log hygiene
The standing review has to be an artifact rather than a calendar aspiration. Top zero-result queries get read and routed — to the synonym dictionary where the corpus has the thing, to content or merchandising owners where it does not. Flat click curves become relevance work, gated by the offline evaluation discipline so that a change intended to fix one query class does not quietly regress twenty others. Suggestions that are shown constantly and picked never go back to the suggest surface. Findings become tickets with owners, because a finding without an owner is a screenshot in a channel.
Before-and-after verification closes the loop. The metrics here are the online evidence, and they pair with offline checks against a golden query set rather than substituting for them: online numbers tell you what happened to real traffic including everything else that changed in the same period, and offline checks tell you what your change did in isolation. Neither one alone is sufficient to say a relevance change worked.
Log hygiene deserves stating plainly, because the search box is an exposed surface. People type their own names into it. They type email addresses, order numbers, tracking codes, and queries that reveal health conditions, legal trouble, and financial circumstances. Query logs are user-generated data with real exposure, and that carries engineering obligations here regardless of what any policy document says: a bounded retention window rather than indefinite accumulation, access control on the log store rather than a dashboard anyone can open, and masking of identifier-shaped patterns — sequences that look like card numbers, email addresses, or account identifiers — before the logs reach general-purpose analytics tooling. Whether a particular processing activity has a lawful basis, and what a consent notice must say, is a question for the privacy literature; what belongs here is that these practices are built into this pipeline.
One last boundary. What search contributed to revenue, and how it sits in a multi-touch path across sessions and channels, is journey-wide attribution and belongs to the customer-journey measurement literature. This surface instruments the feature, not the funnel — and the feature's own numbers are enough to keep it from rotting.