Personalize Recommendations for Anonymous Users using SessionId


For the User-Personalization recipe:

According to this documentation:

It seems like we should be able to query the Personalize engine for a session_id if it has interactions and does not have a user_id. However, when trying this and querying with a session_id, it still returns the high popularity items instead of relevant item recommendations.

Is this incorrect, or will it only return relevant items after the user creates an account (e.g. has a user_id in the Users dataset)?

Thanks in advance

asked 2 years ago493 views
1 Answer

If you call the PutEvents API without a userId to send in new interactions for an anonymous user, you can call the GetRecommendations API after 1-2 seconds with the sessionId as the userId to retrieve recommendations that are personalized to the session. Of course, the sessionId from the PutEvents call needs to be the same value in the GetRecommendations API call.

If your PutEvents call(s) have a sessionId and userId specified, you must use the userId as the userId in the GetRecommendations call.

answered 2 years ago
  • When we do a bulk upload from a csv (dataset import job), with interactions having session_ids but no user_ids, is it supposed to be the same way? Or is this functionality dependent upon using the PutEvents functionality? Thanks for your quick response

  • Real-time recommendations (i.e., where recommendations change in (near) real-time based on new interactions) requires that a campaign (or recommender) be used and new interactions are streamed in via the PutEvents API. This also only applies to specific recipes. Check the docs for details.

    New interactions uploaded via import jobs (bulk or incremental imports), will only impact recommendations for known users after the model is fully retrained.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions