> ## 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.

# Plan and check your game events

> Choose the few game events that answer your questions, name them so every report can read them, and check that they arrive before you ship.

The Godot, Unity, and Unreal SDKs already send launches, sessions and errors. Add a small set of your own events on top, and Manalens can show where players stop, what they spend and what brings them back.

## Start from your questions

Write down the questions first, then add only the events that answer them. Most games need fewer than 15 events.

| Question | Events |
| - | - |
| Which links and creators bring players who play? | Automatic `game_open`, plus [tagged links](https://docs.manalens.dev/guides/campaign-links.md) on your website |
| Where do new players stop? | `tutorial_step`, `level_start`, `level_complete`, `level_fail` |
| Do players come back? | Automatic `session_start`. See [retention](https://docs.manalens.dev/features/retention.md). |
| What do players earn and spend? | `resource` with `flow` `source` or `sink` |
| Who pays, and after what? | `purchase`, or a [store integration](https://docs.manalens.dev/integrations/overview.md) |
| Is this build stable? | Automatic `error` and `app_unclean_exit`. See [game health](https://docs.manalens.dev/guides/game-health.md). |

For a full plan per genre, with events, properties and KPIs, see the [tracking plans on manalens.dev](https://manalens.dev/tracking-plans).

## Use the standard events first

Manalens reads these names in the Game KPIs and Game health dashboards, so use them where they fit:

| Event | Properties | Sent by |
| - | - | - |
| `game_open` | `is_first_open`, `first_open_at` | SDK |
| `session_start` / `session_end` | `duration_s` on `session_end` | SDK |
| `error` | `severity`, `message`, `error_type`, `handled`, `fingerprint` | SDK, for engine errors |
| `app_unclean_exit` | `previous_session_id`, `previous_build` | SDK |
| `level_start` / `level_complete` / `level_fail` | `level`, `attempt`, `score` | Your code |
| `resource` | `flow`, `currency`, `amount`, `item` | Your code |
| `purchase` | `amount_cents`, `currency`, `store` | Your code |
| `game_updated` | `previous_version`, `previous_build` | Your code |

See the [event conventions](https://docs.manalens.dev/sdks/app-events.md#event-conventions) for each one.

> [!TIP]
>
> On `purchase`, `amount_cents` is enough: Manalens adds `revenue` (`amount_cents` / 100), so the sale counts in Overview revenue and [attribution](https://docs.manalens.dev/attribution/overview.md). See [game events](https://docs.manalens.dev/data/events/game.md).

## Name your own events

* **`snake_case`, thing first, then what happened:** `tutorial_step`, `boss_defeated`, `wishlist_clicked`, `demo_download`.
* **Past events, from the player's side.** Send the event when it happened, not when it was offered: `quest_complete`, not `quest_complete_button`.
* **One event, many values.** Send `level_complete` with `level: 3`, not `level_3_complete`. Reports can then break down by `level`.
* **Names are case sensitive.** `Level_Complete` and `level_complete` are two events. Agree on names before you write code.
* **Keep names stable.** Renaming an event splits its history. Add a property instead.

## Choose properties

* Values are strings, numbers, booleans or null. No nested objects.
* At most 50 properties and 8 KB per event.
* Use numbers for numbers (`score: 1200`, not `"1200"`), so [SQL Explorer](https://docs.manalens.dev/features/explorer.md) and Ask AI can sum and average them.
* Send the same property name with the same meaning on every event: `level` is always the level number.
* No personal data: no emails, names or chat text. Use a stable player ID with [identify](https://docs.manalens.dev/guides/identify-users.md).

The SDKs add the platform, storefront, version, build and engine to every event. You do not need to send them as properties.

## Track your website too

Your website is where most players first meet your game. With the [Web SDK](https://docs.manalens.dev/sdks/web.md) on it, track the clicks that lead to the game:

```js theme={null}
analytics.track('wishlist_clicked', { store: 'steam', placement: 'hero' });
analytics.track('demo_download', { platform: 'windows' });
analytics.track('newsletter_join', { placement: 'footer' });
```

Then a [funnel](https://docs.manalens.dev/features/funnels.md) can go from the first visit to `wishlist_clicked`, `game_open`, `tutorial_step` and `purchase`, for one player.

## Check before you ship

**1. Tag test builds**

Dev and live data go to the same project. Set `build` to `"dev"` in development builds (for example in the editor) and filter by it, so your production numbers stay clean.

**2. Turn on SDK logs**

Set `debug` in the [Godot](https://docs.manalens.dev/sdks/godot.md) or [Unity](https://docs.manalens.dev/sdks/unity.md) SDK to print each queued event and each failed send. On the web, use the [`logger` option](https://docs.manalens.dev/sdks/web#logging) or `data-debug="true"`.

**3. Watch Activity**

Open [Activity](https://docs.manalens.dev/features/activity.md) and play. Check that each event arrives once, with the right name, properties and build. The first launch has `is_first_open: true`.

**4. Test offline**

Start the game without a network, play, quit, connect and start again. The saved events arrive at the next launch.

**5. Test consent**

If you use [consent mode](https://docs.manalens.dev/guides/consent.md), check that nothing arrives before the player agrees.

**6. Switch keys**

Put the production Publishable key in the release build.

## Troubleshooting

| Problem | What to check |
| - | - |
| No events at all | The Publishable key, and the SDK `debug` logs. An editor or a disabled SDK sends nothing. |
| `403` from a web build | The page host must be your project domain or an [allowed origin](https://docs.manalens.dev/sdks/app-events.md#allowed-origins), such as `*.itch.zone`. |
| An event in `errors` | An invalid event is refused alone and listed in `errors` of the response: a bad UUID, a missing `session_id`, an event older than 7 days, or an unknown field. When no event of the batch is valid, the batch gets `400`. See [errors](https://docs.manalens.dev/api/errors.md). |
| An event shows twice under two names | Names are case sensitive. Pick one spelling. |
| My own test players count | Set `build` to `"dev"` in test builds and filter by it, or exclude your test hosts with the Web SDK [`tracking` option](https://docs.manalens.dev/sdks/web#local-testing-and-environments). |
| Website visits do not join game players | See [install attribution](https://docs.manalens.dev/attribution/installs.md) and [identify users](https://docs.manalens.dev/guides/identify-users.md). |


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