This seems like a newb question but I’m getting confused between theory and practice here when it comes to Ampltiude Sessions.
Here’s what’s I read from Amplitude Docs:
- For mobile, a session begins when the app is brought into the foreground; it ends when the app goes into the background and no events are fired for at least five minutes. All events sent within five minutes of each other are counted towards the current session. Note that you can define your own session expiration time by calling setMinTimeBetweenSessionsMillis(timeout) , where the timeout input is in milliseconds.
- On a browser, a session begins when the website is opened and the SDK is initialized; it ends when the last event is triggered. Web sessions time out after 30 minutes by default. All events fired within 30 minutes of each other are counted as part of the same session. This timeout window can be customized via the JavaScript SDK configuration options.
However, this seems contradictory when in practice, so I have the following questions:
- The documentation seems incorrect. A session doesn’t really start when the app is in the foreground. It only starts when the first event is fired, right?
- Does amplitude really track when the app is in the background vs foreground? It seems to claim if I don’t fire an event for 10 minutes, but I haven’t left the app, then it still counts as 1 session. Is this correct? Or will it already count as a new session if I fire another event after 10 minutes regardless of background/foreground status?
- If I decide to use Amplitude’s in-built Start Session and End Session, the docs say: “The End Session event will be sent at the start of the user's next session”. Does this mean the session will last all the way until the next session? Or is the session timeout still in use here? And if so, what is the need for the “End Session” event?
- Lastly, one of my concerns for my product is that users may use the app for a while to play around, but never hit one of our events. This kind of session seems pretty impossible to track without logging very basic events that would be both meaningless to us and expensive to upkeep. Is there a way to effectively track the length of these type of sessions?
Sorry, way too many questions. But they are all related, and I hope the thread can clarify for others looking into sessions as well 🙏
Best answer by Zhenia Semenina
View original