> ## Documentation Index
> Fetch the complete documentation index at: https://docs.manalens.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Game events

> Reserved track events for games and apps: game_open, session_start, session_end, level events, resource, purchase, error and app_unclean_exit.

Game and app builds send normal [`track`](https://docs.manalens.dev/data/events/track) events with `context.app`. Some event names are reserved: the [Godot SDK](https://docs.manalens.dev/sdks/godot.md) and the [Unity SDK](https://docs.manalens.dev/sdks/unity.md) send them for you, and reports and templates read them. Other engines can send the same names to the [events endpoint](https://docs.manalens.dev/sdks/app-events.md).

## Automatic events

The Godot and Unity SDKs send these events without any code:

| Event | Properties | When |
| - | - | - |
| `game_open` | `is_first_open` (bool), `first_open_at` (ISO time) | Each launch, from `init()` |
| `session_start` | none | A new session starts: a launch, or a return after 30 minutes idle |
| `session_end` | `duration_s` (number), `errors_dropped` (number, when errors were dropped) | The session ends: quit, or 30 minutes idle |
| `app_unclean_exit` | `previous_session_id`, `previous_build`, `previous_app_version` | At the next launch, when the last run did not exit normally while the game had focus |
| `error` | See below | An engine or script error (Godot 4.5 and later), or an exception, `Debug.LogError` or failed assert (Unity) |

`app_unclean_exit` carries the session ID and the time of the run that crashed, so it counts in that session and that build.

## Conventions

Send these events yourself. The names follow the GameAnalytics event model, as flat snake\_case events.

| Event | Properties | When |
| - | - | - |
| `level_start` | `level`, `attempt` | The player starts a level |
| `level_complete` | `level`, `attempt`, `score` | The player completes a level |
| `level_fail` | `level`, `attempt`, `score` | The player fails a level |
| `resource` | `flow` (`source` or `sink`), `currency`, `amount`, `item` | The player gains or spends an in-game resource |
| `purchase` | `amount_cents`, `currency`, `store` | A real-money purchase |
| `error` | See below | A game error from `track_error()` |

## The error event

| Property | Meaning |
| - | - |
| `severity` | `debug`, `info`, `warning`, `error` or `critical` |
| `message` | The error text, at most 1024 characters |
| `error_type` | The error class, for example `SaveFailed`. Godot engine errors use `engine_error`, `script_error` or `engine_warning`. Unity uses the exception class, `log_error`, `assert` or `log_warning`. |
| `handled` | `false` when the game could not recover |
| `source` | `manual`, `godot_logger` (Godot engine capture) or `unity_log` (Unity log capture) |
| `fingerprint` | The group key for **Top errors** |
| `file`, `line`, `function` | Where the error happened, when known |
| `stack` | The script stack trace, at most 1024 characters |
| `breadcrumbs` | The last 20 event names before the error |

See [Errors and crashes](https://docs.manalens.dev/features/error-tracking.md) for grouping, limits and the Game health dashboard.

## The app context

Every game event has `context.app`:

| Field | Values |
| - | - |
| `platform` | `windows`, `macos`, `linux`, `web`, `android`, `ios`, `other` (required) |
| `storefront` | `steam`, `itch`, `epic`, `gog`, `app_store`, `play`, `other` |
| `app_version` | Up to 32 characters |
| `build` | Up to 64 characters |
| `engine` | `godot`, `unity`, `unreal`, `other` |

Reports read these as the filters and breakdowns `app_platform`, `app_storefront`, `app_version`, `app_build` and `app_engine`. See [common fields](https://docs.manalens.dev/data/events/common.md#app-context).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.