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
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
- https://help.amplitude.com/hc/en-us/articles/115003135607-Track-unique-users
- https://help.amplitude.com/hc/en-us/articles/115002323627-Track-sessions
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
Welcome to the Amplitude Community!
If you don't have an Amplitude account, you can create an Amplitude Starter account for free and enjoy direct access to the Community via SSO. Create an Amplitude account. You can also create a Guest account below!
If you're a current customer, select the domain you use to sign in with Amplitude.
analytics.amplitude.com analytics.eu.amplitude.comWelcome to the Amplitude Community!
If you don't have an Amplitude account, you can create an Amplitude Starter account for free and enjoy direct access to the Community via SSO. Create an Amplitude account. Want to sign up as a guest? Create a Community account.
If you're a current customer, select the domain you use to sign in with Amplitude.
analytics.amplitude.com analytics.eu.amplitude.comEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.