Hello! I need to reset the Amplitude session, device ID, and user ID when a user logs out. I'm essentially looking for a way to perform an amplitude.reset()
operation on the backend (in Ruby). Is this possible?
Page 1 / 1
Hello Cathy,
Thanks for writing to Support. Happy to help!
The `amplitude.reset()` function is available in the Amplitude SDKs and is typically used on the client-side (like in a browser or mobile app) to clear user data when a user logs out. This function sets the `userId` to `null` and generates a new `deviceId.`
However, for a server-side implementation like in Ruby, the concept of resetting a session doesn't exactly apply in the same way. On the server-side, you typically send events to Amplitude with a `userId` and/or `deviceId` that you manage. When a user logs out, you would stop associating events with that user's `userId` and/or `deviceId`.
If you want to mimic the behavior of `amplitude.reset()`, you could generate a new `deviceId` for the user after they log out and stop associating events with their old `userId`. However, please note that this is not a built-in function of the server-side SDKs and would need to be managed in your application logic.
I hope this helps! Let me know if you have any other questions.
Best,
Jacenda
P.S. Checkout upcoming events and user meetups on our events page.
Thanks for writing to Support. Happy to help!
The `amplitude.reset()` function is available in the Amplitude SDKs and is typically used on the client-side (like in a browser or mobile app) to clear user data when a user logs out. This function sets the `userId` to `null` and generates a new `deviceId.`
However, for a server-side implementation like in Ruby, the concept of resetting a session doesn't exactly apply in the same way. On the server-side, you typically send events to Amplitude with a `userId` and/or `deviceId` that you manage. When a user logs out, you would stop associating events with that user's `userId` and/or `deviceId`.
If you want to mimic the behavior of `amplitude.reset()`, you could generate a new `deviceId` for the user after they log out and stop associating events with their old `userId`. However, please note that this is not a built-in function of the server-side SDKs and would need to be managed in your application logic.
I hope this helps! Let me know if you have any other questions.
Best,
Jacenda
P.S. Checkout upcoming events and user meetups on our events page.
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.comor
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. 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.comor
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.