Update user ID by session

  • 30 August 2021
  • 1 reply

Is there a way to update the session ID by the user?

I set the email as the user id after the user login, but before that i hace in the user id a numeric one, so to keep tracking the same user in the session i want to update the user id in the session. (The email address is not changeable so is unique forever), in another topic is there any way to track the download electron app? and track the same user in the app downloaded by passing session or something like this? 

1 reply

Userlevel 1
Badge +2

Hello @antoniott15,

Thanks for your question. Happy to help!

From what I understand, you want to know if you can set session IDs by user, is that correct?

If that is the case, then yes you can set session ID by user by sending in session ID via the HTTP API. I have linked the documentation on sending event data via the HTTP API here:

In regard to your note on the user ID changing, I am not sure exactly what it is that you are asking. Could you kindly elaborate further?

Please note, once the user ID is set for a user it cannot be changed. User ID is a unique identifier for a user, therefore, if you are to change the user ID in subsequent calls this will actually create a new user and not update the user ID of the existing user. You can read more on how Amplitude tracks unique users in the documentation linked here:

In regard to your latter questions, you can track an event like 'download app' or 'app install' via the iOS or Android SDKs. If you want to implement cross-domain tracking, you can reference this section of the Tracking Unique Users documentation which covers the topic of passing session ID: 


I hope this is helpful! Please let me know if you have further questions.