UserTokens are a crucial part of your Algolia implementation, and getting them right can significantly improve the efficiency and accuracy of features such as Personalization, Dynamic Re-Ranking (DRR), A/B Testing, Query Categorization (QCat), and Analytics.
A userToken helps Algolia understand who is performing a search and correctly link that user's events to their searches. This allows us to aggregate queries correctly, track user behaviour accurately, build reliable user profiles for Personalization, and ensure each user receives the most relevant experience.
There are a few important points to keep in mind when it comes to userTokens:
- If you don’t send a
userToken, Algolia defaults to using the user's IP address to identify them. - The userToken sent at query time is what Algolia uses to:
- Aggregate queries for Analytics
- Apply Personalization profiles
- Track user behaviour to train DRR and other AI ranking features
- The
userTokensent with events is used only for building user profiles for Personalization. All other features use theuserTokensent with queries. - For best results, the userToken should be unique per user, consistent throughout their journey, and persisted across sessions.
Below you can find the most common userToken related questions and troubleshooting topics:
Query-Time userTokens
Best practices for sending userToken with search requests and how they affect downstream features:
- Which user token should I send at query time? - userToken and authenticatedUserToken best practices
- How can I send a userToken with a search request if I use a caching mechanism?
- What is the best practice for identifying userTokens if a login is possible at any point in the customer journey?
Event-Time userTokens
Sending userToken with events and how they behave:
- Does my event userToken have to match with my query userToken for the event to be considered for Dynamic Re-Ranking (DRR)?
- The debugger shows userTokens in my events, why isn't personalization working?
- Do I need to obtain user consent to use the userCookie for generating a userToken?
UserTokens and their impact on our features
How userToken influences Personalization, DRR, Query Categorization, and A/B Testing, as well as common causes of unexpected behaviour:
- Does my event userToken have to match with my query userToken for the event to be considered for Dynamic Re-Ranking (DRR)?
- The debugger shows userTokens in my events, why isn't Personalization working?
- What impact does setting a user's IP address as their userToken have on Personalization?
- Is authenticatedUserToken used for Personalization?
- Why is my A/B test excluding so many outliers?
- Why has my A/B test returned an unexpected result and uneven search numbers?
- How do userTokens affect Query Categorization?
UserTokens and Analytics
How userToken affects Analytics data collection and query aggregation