Skip to main content

I have a mobile app in React Native. I setUserId when user logs in or registers. I understand that during this session all sent events are personalized. But when user closes the app and opens it in 2 days, he does not need to login, so I do not setUserId manually. But amplitude session is new. I send events in new session. Are these events pesonalized? If yes, how does it happen? Is this data stored on client’s side? If yes, for how long is it stored there?

Hi @Dzmitry Seuruk 

If the user is logged in and starts a new session on the same device, all their events will be attributed to their user id set in their first session and clubbed under a whole new session.

The following articles will help you better understand the nuances of how Amplitude tracks and identifies unique users across different scenarios

The internal workings are handled by the SDK here. Per the docs, when the SDK is run on web, the identity is stored in the browser cookie by default, whereas on native platforms the identity is stored in async storage. The SDK gives you the option to reset the user id if needed after a user logs out.

Hope this helps.


Reply