# How to install game analytics in Godot

> Add the Manalens addon to a Godot 4 project to track launches, sessions, levels, errors, and crashes on desktop, mobile, and web exports.

By Yos Riady. Updated 2026-11-24. Published 2026-11-24. Canonical URL: https://manalens.dev/integrations/godot

The Manalens Godot SDK is an addon in plain GDScript for Godot 4, with no native code. It sends events with HTTPRequest, so it runs on Windows, macOS, Linux, Android, iOS, and Web exports. It sends game_open, session_start, session_end, and app_unclean_exit for you, and on Godot 4.5 or later it also captures engine and script errors.

## Key takeaways

- The Manalens Godot addon is plain GDScript for Godot 4 and runs on Windows, macOS, Linux, Android, iOS, and Web exports.
- Call Manalens.init() once in the _ready() of your first scene, with build set to dev in the editor so you can filter editor runs out of reports.
- The Godot addon saves the queue on disk, keeps at most 1000 events, and drops events older than 7 days.

## How do I add the Godot addon?

The Manalens Godot addon is open source (MIT) on GitHub. Download the v0.1.0 release, or clone the repository.

1. Download the addon from the manalens-godot repository on GitHub.
2. Move addons/manalens into the addons/ folder of your project.
3. Open Project, Project Settings, Plugins, and enable Manalens. The plugin adds the Manalens autoload.

- [Manalens Godot SDK on GitHub](https://github.com/manalens/manalens-godot)
- [Example: with-godot](https://github.com/manalens/examples/tree/main/with-godot)

## How do I start the Godot SDK?

Call init() once, in the _ready() of your first scene. The autoload is ready before your scene starts and stays loaded when you change scenes. Use the Publishable key from your project settings; it is safe to ship in a build. Leave the SDK on in the editor, so you can watch your events arrive. Editor and live data go to the same project, so the example sets build to dev in the editor; filter by build to leave editor runs out of a report.

*GDScript*

```gdscript
func _ready() -> void:
    Manalens.init({
        "publishable_key": "YOUR_PUBLISHABLE_KEY",
        "endpoint": "https://events.manalens.dev",
        "app_version": "1.4.0",
        "build": "dev" if OS.has_feature("editor") else "571",
        "storefront": "steam",
    })
```

## How do I track game events in Godot?

Use flat snake_case names: level_start, level_complete, level_fail, resource, and purchase. Property values are String, int, float, bool, or null. Call identify() after the player signs in, and track_error() for errors that you catch yourself.

*The functions of the Manalens Godot addon.*

| Function | What it does |
| --- | --- |
| init(options) | Starts the SDK and sends session_start and game_open |
| track(event, properties) | Records an event |
| identify(user_id, traits) | Attaches a player ID, kept on disk, and traits |
| track_error(message, options) | Sends an error event with severity, error_type, and handled |
| link_url(url) | Adds the handoff parameter to a website URL |
| set_consent(granted) | Starts tracking, or deletes the ID, the session, and the queue |
| flush() | Sends queued events now |
| await shutdown() | Sends session_end and flushes before your own quit |

*GDScript*

```gdscript
Manalens.track("level_complete", {"level": 3, "attempt": 1, "score": 1200})
Manalens.identify("player_42")
Manalens.track_error("Save failed", {"error_type": "SaveFailed", "severity": "critical"})
```

## How do I link the game to my website?

Open your website from the game with link_url(). The website then joins this player without identify(). The link needs the web SDK on the website.

*GDScript*

```gdscript
OS.shell_open(Manalens.link_url("https://example.com/wiki"))
```

## How do I check that Godot events arrive?

Press Play in the editor or run an exported build. Set debug to true to log each send and each dropped batch. Check that game_open and session_start appear in the project activity feed. Events are sent every 10 seconds, at 20 queued events, on focus loss, and on quit.

For a Web export, Manalens accepts requests from your project domain, its subdomains, and *.itch.zone. Add other game portals under Project settings, Allowed origins. To test the web export from the editor, add localhost.

## Frequently asked questions

### Which Godot versions are supported?

The addon needs Godot 4. It is plain GDScript with no native code and sends events with HTTPRequest, so it runs on Windows, macOS, Linux, Android, iOS, and Web exports. Automatic capture of engine and script errors needs Godot 4.5 or later.

### What happens offline?

The queue is saved in user://manalens_queue.json, so events survive a crash or an offline session and are sent later with retries. At most 1000 events are kept, and events older than 7 days are dropped. Each event has a message ID, so a retry never counts twice.

### How do I keep editor runs out of my reports?

Editor runs send events like a live game, so you can watch them arrive in the activity feed. Editor and live data go to the same project. Pass "build": "dev" if OS.has_feature("editor") else "571" to init(), and filter reports by build. To send nothing from the editor, pass "enabled": not OS.has_feature("editor") instead.

### Is there a complete example?

Yes. The with-godot project in the Manalens examples repository on GitHub is a Godot 4 project with the addon, level events, track_error(), and link_url(). Run it headless with -- --demo to send a short set of events to a Manalens test project.

## Sources

- [Godot documentation: Installing plugins](https://docs.godotengine.org/en/stable/tutorials/plugins/editor/installing_plugins.html)
- [Godot documentation: Singletons (Autoload)](https://docs.godotengine.org/en/stable/tutorials/scripting/singletons_autoload.html)
- [Godot documentation: HTTPRequest](https://docs.godotengine.org/en/stable/classes/class_httprequest.html)

## Related guides

- [Example project: with-godot](https://github.com/manalens/examples/tree/main/with-godot)
- [How to add analytics to a Godot game](https://manalens.dev/blog/godot-analytics)
- [GodotSteam achievements and stats: a Godot 4 guide](https://manalens.dev/blog/godotsteam-achievements-and-stats)
- [How to track an itch.io game](https://manalens.dev/integrations/itch-io)
- [Godot SDK reference](https://docs.manalens.dev/sdks/godot)
