Guides / Getting insights and analytics / Search analytics

Out-of-the-Box Analytics

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:

Search analytics

Which searches do we capture?

Every keystroke

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.

Empty query

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 <empty search>.

More on query “aggregation”

In order for the above to work, we need some way to aggregate the keystrokes. We do this based on different indicators, such as edit distance, timestamp and most importantly the user ID. The user ID is by default the IP address that performs the search. You can override this default by providing a user token.

When you perform searches from your back end, the IP address related to the search will be your servers’ IP address. This means the analytics will not be reliable if you don’t provide a unique identifier for the user you’re performing this search for. You can do this in two ways:

  • Set the X-Algolia-UserToken header to forward a user ID, or use the userToken parameter. This token is used to perform query aggregation and to compute the user count.
  • Set the X-Forwarded-For header to forward the users’ IP address. This IP is used as user token if you don’t provide one. The users’ IP address is also required for geolocation to work properly.

Without this, the aggregations and thus most of the metrics won’t be properly computed.


To simplify the analysis of your customer’s behavior, the queries you see in the analytics are normalized. They are put in lowercase with diacritics removed. For example, statistics for the query “Beatles” are grouped with “beatles” because they return the same results, just like “café” and “cafe”.

Diacritics can be kept according to the keepDiacriticsOnCharacters setting.

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

While analytics are accessible from the dashboard, you can also use our Analytics API to retrieve the results of your search analytics for reporting.

API Reference Analytics REST API

Did you find this page helpful?