Attach user tokens to queries
To ensure that the Advanced Personalization feature can understand each user’s journey and continuously improve their personalization experience, attach a user token to each query. The user tokens attached to the queries must match the user tokens sent with events.This feature isn’t available on every plan.
Refer to your pricing plan to see if it’s included.
Attach user tokens with InstantSearch
To include theuserToken
in your search queries using InstantSearch, use the configure
widget to set the userToken
search parameter.
Attach user tokens with an API client
To include theuserToken
in your search queries with an API client, use the search
method to send the userToken
search parameter.
Persist user tokens
For user profiles to be found and retrieved at search time, you should persist anonymous user tokens and authenticated user tokens across sessions.Avoid enabling personalization at query time
Rather than using theenablePersonalization
search parameter at query time, set it in the index settings when moving to production. This lets you A/B test the impact of personalization without having to modify code.