When it comes to analyzing as-you-type search, it can be hard to define what counts as a "search". You might wonder why it isn’t simple: just record and count every query sent to Algolia as a search, right? The problem with this approach is that not every query that your users send is indicative of what they are looking for. Counting every query dilutes your analytics data and makes it less accurate.
Query vs. search
Suppose you have as-you-type search enabled, and your user is searching for the word “apple”. They type in “a”, which is sent as a query to Algolia. They type in “p”, and “ap” is sent as a query as well. They type in “p”, and “app” is sent as a query, and so on. In total, searching for this term results in five queries, and even though each query is related to the final search, the first few have little to do with “apple”.
To address this, we maintain a distinction between queries and searches. Each keystroke generates a query, but a search is defined on the final query. The creation of a single search from multiple queries is called query aggregation.
Analytics discrepancies between platforms
Our query aggregation strategy is not only a question of determining a “final search”. What do we do if a user types a search query, doesn’t see what they want, backspaces through the phrase, and types something else? It’s important not to throw away the first full query because it provides valuable information, but it’s also hard to determine whether it’s a final search or a mistype.
As a result query aggregation relies on a number of factors, including IP address, timezone, and time frame. Different analytics platforms have different query aggregation strategies. Therefore, they also have different analytics results.