Skip to main content
By default, Algolia uses IP addresses to distinguish users. To get more accurate analytics, set a userToken on search requests. If you send searches from your backend, set a userToken to avoid grouping many users under the same server IP address. To learn what a user token is, how to generate it, and how to handle anonymous and authenticated users, see User token.
A userToken is also required for Personalization.

Before you begin

Use the same userToken for searches and click and conversion events so analytics can associate activity with the same user.

Set the user token in InstantSearch and Autocomplete

Set the insights option to true when initializing InstantSearch or Autocomplete.
For more information, see:

Set the user token in InstantSearch iOS and Android

Add the userToken as an API parameter to your search requests:

Set the user token with API clients

Use the same userToken in search requests and click and conversion events. To set the user token per search request:
To set the user token when you initialize an API client:

If you can’t set a user token

If you search from your backend and can’t or don’t want to set a userToken, you can forward user IP addresses to improve analytics accuracy.
Last modified on June 19, 2026