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

# Analytics: wire events into your game and read them in Grow

> What Summer counts for every published game, how to send custom events before you export, where they work, and how to read the numbers in Studio Grow or through your agent.

Do this **before you export**: events your game sends are only in the builds that include them.

<img className="block dark:hidden" src="https://mintcdn.com/summer-18f03259/lAIp8hql2BjHQCvb/images/guide-art/publishing/analytics-light.svg?fit=max&auto=format&n=lAIp8hql2BjHQCvb&q=85&s=bf26f1c55dd0760adb9d1f943c0ad51f" alt="Your game's own events, such as level_completed, and the numbers Summer counts for you, page views, launches and play time, both show in Grow, Analytics: tiles for the totals and bars by day." width="880" height="250" data-path="images/guide-art/publishing/analytics-light.svg" />

<img className="hidden dark:block" src="https://mintcdn.com/summer-18f03259/lAIp8hql2BjHQCvb/images/guide-art/publishing/analytics-dark.svg?fit=max&auto=format&n=lAIp8hql2BjHQCvb&q=85&s=d43aaced1e0703bf56a46155583fe2b8" alt="Your game's own events, such as level_completed, and the numbers Summer counts for you, page views, launches and play time, both show in Grow, Analytics: tiles for the totals and bars by day." width="880" height="250" data-path="images/guide-art/publishing/analytics-dark.svg" />

## What Summer counts for you

Every game on Summer Games gets four numbers with no code and no setting:

| Number | Counted when |
| - | - |
| **Store page views** | someone opens your game's page on summer.games |
| **Launches** | the game starts in the Summer Games desktop app or in the browser |
| **Play sessions** | a play session ends: the game quits, or the player leaves the browser game |
| **Play time** | the length of each finished session, added up |

These do not use your analytics storage, and their history does not expire. Days are in UTC. Launches and play time from the iPhone and Android apps come later.

## Send your own events

For things only your game knows: `level_completed`, `boss_defeated`, `tutorial_step_completed`. The full guide, with prompts for your agent, is [See what players do](/build/analytics). The short version:

```gdscript theme={null}
var _analytics_warned := false

## Fire and forget: never await this, never retry it.
func _track(event: String, properties: Dictionary = {}) -> void:
	var capture := Summer.client.analytics.capture(event, properties)
	var result: SummerResult = await capture.get_result_or_completed_signal()
	if not result.ok and not _analytics_warned:
		_analytics_warned = true
		push_warning("analytics unavailable: %s" % result.code)

func _on_level_completed(level: int, seconds: float) -> void:
	_track("level_completed", {"level": level, "seconds": int(seconds)})
```

On a multiplayer server, use `Summer.authority.analytics.capture` for what the server decides: a match won, a coin collected, an item bought.

### Rules

* **Names** are fixed words in the past tense: 1-64 characters, matching `^[A-Za-z][A-Za-z0-9_.:-]{0,63}$`. Never start a name with `summer.`.
* **Values go in properties**, not in names: `{"level": 3}`, not `level_3_completed`.
* **Properties:** at most 64 values, nested at most 4 deep, one event at most 16 KiB.
* **No personal data:** no emails, ids, tokens or text the player typed. Summer adds the player, game and build itself.
* **Gameplay never waits.** Call `_track(...)` without `await`.
* **Never send again after a failure.** The first call may already be stored.

<Prompt description="**Add analytics before I publish.** Your agent adds a few events that answer your questions.">
  Before I export my Summer game, add analytics events for \[WHAT, for example
  "each level started and finished, and where players quit the tutorial"]. Use
  the Summer `summer-analytics` skill; if you don't have it installed, find it
  in the Summer library.

  * Fixed event names in the past tense, with the details in properties.
  * Server decisions on the server; menu and tutorial moments on the client.
  * Never wait for an event, never send it again, no personal data.

  Read my project first and list the events you'd add before you change anything.
</Prompt>

### Where your events work

| Where the game runs | Your events |
| - | - |
| Summer Games desktop app (Mac, Windows) | Yes |
| Summer Games apps for iPhone and Android | Yes |
| Multiplayer server | Yes |
| Browser (summer.games web player) | Not yet: `capture` reports `unavailable` |
| Local Play and the editor | No: `capture` reports `unavailable`, nothing is stored |

**Storage:** each game keeps 10,000 custom events for 7 days for free. Send a few events that answer questions, not one per frame.

## Read your numbers

### In Studio

Open **Grow → Analytics**, pick your game and 7, 28 or 90 days. You see:

* store page views, launches, play sessions and play time, as totals and by day;
* the average play session;
* **Custom events your game sent**, with counts.

### With your agent

`summer_grow_overview` reads your Grow numbers: players, new players, sessions, play time, day-7 retention, peak players and Sparks earned, for all your games or one.

```json theme={null}
{ "tool": "summer_grow_overview", "gameId": "<gameId>", "range": 28 }
```

| Input | Meaning |
| - | - |
| `about` | `overview` (default), `games` or `earnings`. Ignored when `gameId` is set. |
| `gameId` | One game: its Grow game id or title. |
| `range` | 7, 28 or 90 days. Default 7 (earnings 28). |

If the answer says `sample: true`, the numbers are sample data, and your agent says so.

<Prompt description="**How is my game doing?** Your agent reads your Grow numbers and tells you what they mean. No changes.">
  Tell me how my game is doing on Summer Games over the last 28 days. Use the
  Summer Engine MCP: summer\_grow\_overview for my game. Don't change anything.

  Name each number with its window. Tell me what stands out, and which one or
  two events I should add to my game to understand players better.
</Prompt>

## Checklist before you export

* [ ] The game sends 3-10 events that answer your questions, such as where players stop and what they finish.
* [ ] No `await` on `_track` in gameplay code.
* [ ] No personal data in properties.
* [ ] Under Local Play the game plays normally while events report `unavailable`.
* [ ] After the first published build, open Grow → Analytics and check that your events appear. A short delay is normal.

## Technical reference

Exact methods and inputs: [`Summer.client.analytics`](/api-reference/gdscript/client/analytics), the [`summer_grow_analytics`](/mcp/tools/grow#summer_grow_analytics) MCP tool, and the [analytics HTTP API](/api-reference/http/overview#analytics).

***

Does this not help you? [Reach out on Discord!](https://discord.gg/summerengine)


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