userToken
userToken => 'YourCustomUserId'
Can be used in these methods:
search,
browseObjects,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
search,
browse_objects,
search_for_facet_values,
generate_secured_api_key,
add_api_key,
update_api_key
search,
browseObjects,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
search,
browse_objects,
search_for_facet_values,
generate_secured_api_key,
add_api_key,
update_api_key
search,
browse,
searchForFacetValues,
generateSecuredApiKey,
addAPIKey,
updateAPIKey
search,
browseObjects,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
Search,
Browse,
SearchForFacetValues,
GenerateSecuredApiKey,
AddApiKey,
UpdateApiKey
Search,
browse,
searchForFacetValues,
generateSecuredApiKey,
addApiKey,
updateApiKey
Search,
BrowseObjects,
SearchForFacetValues,
GenerateSecuredAPIKey,
AddAPIKey,
UpdateAPIKey
search,
browse index,
search into facet values,
generateSecuredApiKey,
add key,
update key
About this parameter
Associates a certain user token with the current search.
Sending a user token will associate a search with a certain user. The insights taken from this could be used in combination with personalization for example.
Make sure to use the same user token for your events (Insights API) and search requests (Search API).
- If you send the
authenticatedUserToken
with your events, send the same value with your search requests. - If you send the
userToken
with your events, send the same value with your search requests.
For more information about the correct format of a user token, see userToken
(Insights API).
Examples
Set the user token
1
$index->search('query', ['userToken' => '123456'])
Enable personalization for the current search and specify a user token
1
2
3
4
$index->search('query', [
'enablePersonalization' => true,
'userToken' => '123456'
]);