Skip to main content

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? 

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: https://developers.amplitude.com/docs/http-api-v2#request-format.

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: https://help.amplitude.com/hc/en-us/articles/115003135607

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: https://help.amplitude.com/hc/en-us/articles/115003135607#h_f717e48c-460c-4a17-abd7-102327673798 

 

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


Reply