You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While there is a very helpful method to get the session id from Amplitude, there is no way to be notified of when it changes. We'd like some way of knowing when the session changes so we can log our own session start events as well as so we can expose a lightweight way of being notified about the changes that do not require linking to the Amplitude SDK directly.
Two example ways of doing this might be:
A public delegate protocol we can adopt to be directly notified about session changes.
An NSNotificationCenter notification we could observe with a frozen (never changing ever) notification name.
I'd specifically like to be notified when the ID changes. I'd expect that the method would be called on every new app boot as well as any time the session id changes when the app's still stood up (not terminated). My names above are only suggestions, obviously feel free to name it what you think makes the most sense.
Motivations
At Dropbox, we're in the process of re-working a lot of our analytics logging. One thing that's missing is that we don't have a good app-wide session ID, we only have what get logged by Amplitude (to which only a subset of our logs are passed). We would like to adopt the Amplitude SDK's session id as our app-wide session id.
In order to do this, we'd want to also attach it to our legacy events and events that might go to other destinations besides where Amplitude sends events, as well as logging our own session start/end events with custom information and naming. The feature would allow us to log those custom session start/end events as well as more easily expose the session id via rx-style observables to other parts of the app without needing to link to the Amplitude SDK.
Lastly, this would be something we'd also want on Android's SDK.
Please let me know how amenable this is and whether it can be done. Thank you!
The text was updated successfully, but these errors were encountered:
HI @jboulter11, thanks for providing such detailed description and potential solutions. Can I know why you want to log your own session start events as the SDK supports out-of-box session tracking?
Also a heads up here that we are planning to GA Swift SDK next quarter and put iOS SDK to end-of-support status according to the maintenance and support policy. We will put this into our backlog, but regarding to our deprecation plan, unless it's blocking data ingestion, it has a limited chance to be put into our roadmap unfortunately.
Hi @jboulter11, you can hook into the event stream using Middleware. Middleware is called for each event, including session events. If you set trackingSessionEvents = YES you can then add a custom middleware to handle the event_type=session_start event. Hope this helps!
Summary
While there is a very helpful method to get the session id from Amplitude, there is no way to be notified of when it changes. We'd like some way of knowing when the session changes so we can log our own session start events as well as so we can expose a lightweight way of being notified about the changes that do not require linking to the Amplitude SDK directly.
Two example ways of doing this might be:
I'd specifically like to be notified when the ID changes. I'd expect that the method would be called on every new app boot as well as any time the session id changes when the app's still stood up (not terminated). My names above are only suggestions, obviously feel free to name it what you think makes the most sense.
Motivations
At Dropbox, we're in the process of re-working a lot of our analytics logging. One thing that's missing is that we don't have a good app-wide session ID, we only have what get logged by Amplitude (to which only a subset of our logs are passed). We would like to adopt the Amplitude SDK's session id as our app-wide session id.
In order to do this, we'd want to also attach it to our legacy events and events that might go to other destinations besides where Amplitude sends events, as well as logging our own session start/end events with custom information and naming. The feature would allow us to log those custom session start/end events as well as more easily expose the session id via
rx
-style observables to other parts of the app without needing to link to the Amplitude SDK.Lastly, this would be something we'd also want on Android's SDK.
Please let me know how amenable this is and whether it can be done. Thank you!
The text was updated successfully, but these errors were encountered: