User Sessions FAQ
This page answers common questions about the User Sessions chart.
Why is my User Sessions chart empty?
The User Sessions chart requires valid session IDs for events. A valid session ID has a value other than -1. To check whether the events in your project have session IDs, check any user's event streams.
Why are there so many zero-length sessions in my User Sessions chart?
Two likely causes explain a large number of users in the "0 sec" session data point in the User Sessions chart.
Potential cause #1: Out-of-session events
Amplitude calculates session length for events sent with the HTTP API using this formula:
max(client_event_time) - session_id
For these events to count as part of a session, the session ID must be a timestamp reflecting the beginning of the session in epoch time.
Potential cause #2: You're tracking the Start Session event, but no other events
If your project allows sending start or end session events (which you can enable in the Android SDK or iOS SDK), your app sends a Start Session event to Amplitude every time it launches in the foreground. If Amplitude receives no other events to log after this, it sets the session length to zero.
Amplitude's Microscope feature lets you examine a user's activity, so you can quickly determine which of these causes is the issue.
When does the Amplitude Start Session event trigger?
The event triggers when the app enters the foreground, or when the SDK initializes in the foreground.
Why are there empty sessions with no active events in the user event streams?
When you use mobile SDKs with start or end session events enabled, you might see sessions that include only the Start Session and End Session events. A few reasons explain this:
- The user enters and leaves the app without triggering custom events.
- The user triggers events that are blocked or deleted in your tracking plan, so Amplitude doesn't ingest them.
- Certain activities in the app, like backend notifications or identify calls, can bring the app to the foreground without triggering an actual event.
Why do some mobile sessions contain a gap of over five minutes, or why do some sessions last an unusually long time?
Some common reasons:
- The default session timeout window changed. Mobile SDKs use five minutes by default.
- Activities in the app, like backend notifications or identify calls, can bring the app to the foreground between two actual sessions, leading to unexpectedly long sessions.
Does a change to a custom session apply retroactively?
Yes. After you change the custom session definition, Amplitude groups all sessions, including those logged before the change, based on the new definition.
Does the custom session definition affect the raw data?
It doesn't affect the raw data, and you can revert it to the default session definition at any time.
Does a server-side integration between Amplitude and Segment provide a Session ID automatically?
Go to the FAQ article on Segment/Amplitude integration to learn more.
Was this helpful?