I'm working on a web application and using AWS Personalize to provide customized content to both guests and registered users. I'm facing a challenge in handling visitor IDs in scenarios where a guest later logs in as a registered user.
Here's the situation:
- A visitor enters the site and is assigned a unique visitor ID as a guest.
- The visitor browses and interacts with the site, generating data linked to this guest visitor ID.
- Later, the visitor logs in, and we have their registered user ID.
The challenge is in handling the transition from a guest visitor ID to a registered user ID without losing the personalization data gathered during the guest session. Ideally, I want to merge or transition the data from the guest session to the registered user profile in AWS Personalize.
I am considering a solution where I could store the events from the guest user session and, upon login, send all these events tagged with the registered user ID to AWS Personalize. However, this approach might result in the duplication of events (once as a guest and then as a registered user), leading to data redundancy and potential skew in personalization results.
How can I effectively merge or transition the guest session data to the registered user's profile in AWS Personalize?
Thank you in advance for your help!
Personalize handles this for you. From the docs:
Therefore, for anonymous users/visitors, use the visitor ID as the
sessionId
when calling PutEvents (excluding theuserId
field) AND as theuserId
value when calling GetRecommendations. Then, when the visitor signs in, continue to use the same visitor ID as thesessionId
but this time include theuserId
in PutEvents. When calling GetRecommendations for identified visitors, user their durable user ID as theuserId
field value. Prior anonymous events will be joined to the user at the next retraining.