Skip to main content
The session_start and session_end events record the start and the end of a game session: one run of the game, from launch to quit, or until the player is away for 30 minutes. They are track events. The game reports read them: D1, D7 and D30 retention count a return with session_start, and Session length and Playtime per DAU read duration_s of session_end. See game metrics. Every event of a session has the same session_id. The SDK makes a new ID for each session.

When they are sent

The Godot, Unity and Unreal SDKs, and the Web SDK with game: true, send them for you.
  • Quit: a desktop game delays its quit to send session_end and the queue, for at most 2 seconds by default. The option is quit_timeout_s in Godot, QuitTimeoutSeconds in Unity, and Quit Timeout Seconds in Unreal. Unsent events stay on disk for the next launch.
  • Focus: focus loss and pause save the state and send the queue. The session stays open while the player is away for less than 30 minutes.
  • Crash: after a crash, the next launch ends the old session and sends game_crash in the session that crashed.
  • Web SDK in game mode: each page load starts a new session. session_end is sent on pagehide, reset() or shutdown(), or, after 30 minutes without events or at 24 hours, with the next event.
  • Consent mode: no session before set_consent(true).
  • Server builds: a dedicated server sends no session events unless you turn on track_server_builds. See For multiplayer games.
  • Other engines: a game that sends app events over HTTP sends session_start and session_end itself, with a new session_id for each session.

Properties

session_start has no properties.

Sample payload

Session ID rules

Reports count sessions from session_id, for websites and games alike. A web or app event must follow the session ID contract:
  • An event with an anonymous_id has a session_id.
  • The session_id is not the anonymous_id.
  • An event before consent has no anonymous_id and no session_id.
The SDKs follow it for you. A website session also starts after 30 minutes without events and is at most 24 hours long. The Web SDK sends no session events outside game mode. See core concepts.

FAQ

Check that your game sends both events. A before_send callback that drops session_start or session_end changes your session counts: sample your own events only. A game on app events must send them itself.
No. The session stays open for 30 minutes without focus or events. After that, the next activity starts a new session.
Yes. Send the client’s session_id with the server event, and it is in that session. Without it, the event joins a session of the same anonymous_id by time. See session ID of the client.