Skip to main content
Solved

Log Out and Anonymous Users

  • June 2, 2022
  • 1 reply
  • 1949 views

Forum|alt.badge.img

Hi All, 

I have a question regarding the Log out the user we want to log events under an anonymous user. 

Based on the explanation below, could you please let me know what will happen to Amplitude ID? As Amplitude ID is used to count unique users, I am bit worried that some users will be counted twice. 

“Log Out and Anonymous Users

A user's data will be merged on the backend so that any events up to that point from the same browser will be tracked under the same user. If a user logs out or you want to log the events under an anonymous user, you will need to:

  1. Set the userId to null.

  2. Regenerate a new deviceId.

After doing that, events coming from the current user/device will appear as a brand new user in Amplitude. Note: If you choose to do this, you will not be able to see that the two users were using the same device.”

Thanks. 
Mateja 

Best answer by Denis Holmes

Hi @Mateja Tomek ,

 

So if you have some User who has the User ID of A and Amplitude ID of 123, and they log some events, they will all be tied to their Amplitude ID of 123, User ID A. If this user just logs out, all the events will have just the Amplitude ID of 123, but since the device ID is the same, it will still be tied to this user with the Amplitude ID of 123, just the User ID will not propagate for the events. However, if they log out AND change their device ID, then a new anonymous user will be generated with a new Amplitude ID because the device ID has changed and there is no User ID set. 
I would also recommend reading this article to help you! :)

 

KInd Regards,
Denis 

View original
Did this topic help you find an answer to your question?

1 reply

Denis Holmes
Team Member
Forum|alt.badge.img+8
  • Team Member
  • 448 replies
  • Answer
  • June 3, 2022

Hi @Mateja Tomek ,

 

So if you have some User who has the User ID of A and Amplitude ID of 123, and they log some events, they will all be tied to their Amplitude ID of 123, User ID A. If this user just logs out, all the events will have just the Amplitude ID of 123, but since the device ID is the same, it will still be tied to this user with the Amplitude ID of 123, just the User ID will not propagate for the events. However, if they log out AND change their device ID, then a new anonymous user will be generated with a new Amplitude ID because the device ID has changed and there is no User ID set. 
I would also recommend reading this article to help you! :)

 

KInd Regards,
Denis 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings