On mobile applications, what is the difference between a session and a visit ?
On mobile applications, visits and sessions are calculated differently and can diverge significantly depending on how users move between the foreground and background.
Visit (mobile apps and web)
A visit is an interaction between a site or application and a visitor who has generated at least one event.
A visit starts when the first event is received.
A visit ends when no events are recorded for a defined period of time (30 minutes by default).
App foreground/background state does not directly end a visit. What matters is whether events continue to be sent.
Example: If a user generates an event, puts the app in the background for 12 minutes, then returns and generates another event, this is still one visit (because inactivity is less than 30 minutes). The time between events can be included in the visit’s duration.
If a user switches an application to the background and then returns to it within 30 minutes, it is still considered a single visit (assuming events resume within that inactivity window).
Session (mobile apps only)
Unlike visits, sessions are specific to mobile applications and track the app’s active usage period.
A session includes all events that:
Start when the application is launched or brought to the foreground
End when:
the application is put in the background for more than 60 seconds, or
the application is killed/closed
Additional notes:
If the app returns to the foreground within 60 seconds, the session continues (it resumes rather than creating a new session).
Time spent in the background is not included in the session duration.
Sessions are identified by a unique
App - Session ID. This session identifier is used because mobile applications cannot rely on browser cookies in the same way websites do.
Common scenario: multiple sessions within one visit
Because a visit is based on event inactivity (30 minutes) and a session is based on app state (60 seconds in background), it’s common to have multiple sessions in a single visit.
Example: A user opens the app at 10:00, backgrounds it at 10:15, reopens it at 10:20, and stops at 10:23. - Visits: 1 (no 30-minute inactivity) - Sessions: 2 (10:00–10:15 and 10:20–10:23)
This is a frequent reason for discrepancies between visit counts and session counts in mobile reporting.