Out-of-the-box Search Analytics helps you model your users’ behavior by breaking down their searches into numerous metrics, like popular searches, number of “no results”, and filter usage. The goal of search analytics is to help you make data-driven decisions when building and improving your search experience.
Collecting search analytics requires no extra effort on your side - No coding is required. It is also transparent to your users: in the background, Algolia gathers large amounts of search-related analytics, capturing data with every search.
From a technical point of view, search analytics will get you thinking more objectively about how to structure your product data, and how to configure your ranking and relevance; they can also lead you to use more advanced API settings to improve your users’ search experience.
For your business, there are an unlimited number of benefits - You can see whether your products are properly described or represented, whether the correct products show up in your search results, and whether, based on the searches, you have too much of one product and not enough of another.
What are we measuring?
- Overall search counts
- A “No search result” rate
- Top searches
- Top searches with no results
- Top results
- If a filter is provided, top searches associated with that filter
- Top filter attributes and filter values
- Distinct count of IP addresses / Users
- Top countries
Here’s an example of what you can expect to measure with Search Analytics:
Which searches do we capture?
There’s a difference between the number of queries executed in the search engine and the number of queries stored by the analytics engine. We executed far more queries than we store.
Our search engine is designed to execute queries at each keystroke. This means that every keystroke triggers a new query in the search engine. This is not the same logic for the analytics engine. In order to have relevant analytics data, we ignore initial keystrokes and keep only the latest (final) query made by the end user.
For example, if a user types in “beatles”, the search engine will perform 7 queries - “b”, “be”, “bea”, “beat”, “beatl”, beatle”, and (finally) “beatles”. The analytics engine, however, will only save 1 query, the last one, “beatles”; it will therefore ignore the first 6 keystrokes, “b”, “be”, “bea”, “beat”, “beatl”, and “beatle”.
This is what we mean by “prefix” or “keystroke” aggregation.
By default, every InstantSearch implementation shows your users results as soon as they land on a page with InstantSearch.
This is done by performing a search with an empty query. This search will show up in your dashboard as
More on query “aggregation”
In order for the above to work, we need some way to aggregate the keystrokes. We use query aggregation techniques, such as edit distance, timestamp, and, most importantly, user ID. The user ID is by default the IP. It is important that requests contain the actual end user IP.
When searches are done from your back end, you need to either:
- set the
X-Forwarded-Forheader to forward the IP.
- set the
X-Algolia-UserTokenheader to forward a user Id.
Without this, the aggregations and thus most of the metrics won’t be properly computed.
Accessing analytics data
Search Analytics are automatically captured. There is nothing you need to do for Algolia to build your search analytic data.
Additionally, collecting this data has no impact on the speed of search.
Search Analytics appear on the dashboard approximately 10 minutes after they occur.
With the Dashboard
All Analytic data is accessible in graphical format via our Analytics Dashboard. Our Analytics Dashboard walks you through each metric. Everything is clickable, you can drill down on the metrics. Furthermore, we provide hints and an easy UI to help you navigate through this data.
With the API (for Enterprise plans only)
While analytics data is more easily accessible from the Dashboard, you can also use our analytics REST API to retrieve the results of your search analytics for reporting.