Typically when we see single letters in Analytics it is related to how users are identified. In many cases, these queries appear because not all users are assigned a unique userToken.
Note that the presence of single letters in the Analytics can be due to the users typing in queries with just two letters, seeing the result they want straight away and clicking on it. In this situation, the short query is valid and expected.
However, if you’re seeing an unusually high number of single-character or very short queries, you should check how users are being identified - especially if you search from your backend.
How query aggregation works
When users type, Algolia receives a request on each keystroke (e.g. “b”, “be”, “bea”, “beat”, “beatl”, beatle”, and “beatles”.).
For analytics purposes, these queries are aggregated so only the last query in a short time window for that user is counted. The user is identified by:
A
userTokenyou provide, orThe user’s IP address (the default fallback identifier)
If multiple users share the same identifier (for example, if all backend searches come from your server’s IP), queries from multiple real users can be aggregated together. This can lead to unexpected analytics, including unusual short queries.
Assign unique user identifiers
If you’re performing searches from your backend, or assigning a single identifier for all users, you should ensure each end user has a unique identifier. You can do this in one of the following ways:
1. Set a userToken on search requests
Use the userToken parameter or set the X-Algolia-UserToken header to forward a user ID,
2. Forward the user’s IP address from your backend
Set the X-Forwarded-For header to forward the users’ IP address.
Ensuring proper user identification will help prevent incorrect aggregation and provide more accurate Analytics data.
For a full list of common userToken issues, troubleshooting topics and best practices, see our summary article here.