A downloadable tool

Buy Now$1.00 USD or more

Send player events from your Godot game straight to PostHog. No SDK to compile, no C# required. Just drop this provider into the Analytics Plugin and you're connected.

One file, one config change. Your events show up in PostHog within seconds.


What it does

This is a provider for the Analytics Plugin for Godot 4.x. It connects your game to PostHog (cloud or self-hosted). The base plugin handles batching, retries, and offline storage. This provider takes care of talking to PostHog's API so you can focus on deciding what to track.

PostHog gives you funnels, retention curves, user paths, and feature flags. This plugin gets your game data in there.

Features

๐Ÿ“ก Batched delivery. Events queue up in memory and get sent together to PostHog's /batch endpoint. Configurable batch size and flush interval.

๐ŸŒ EU and US regions. Defaults to the EU endpoint. Change one line in the config to switch to US.

โฑ๏ธ Timed events. Wrap any gameplay moment with start_timed() and get duration_ms calculated automatically. Perfect for measuring time spent per level, per menu, per match.

๐Ÿ’พ Offline support. If the network drops, events are saved to disk and retried on the next successful flush. Nothing gets lost.

๐Ÿ”‘ Anonymous device ID. A UUID is generated and persisted locally in user://. No login flow needed. Call identify() later if you want to link events to a known player.

๐Ÿชถ Tiny footprint. Pure GDScript, no GDExtension, no external SDK. Just a handful of scripts in your addons/ folder.

Quick start

1. Install the Analytics Plugin if you haven't already
2. Copy posthog_provider.gd into addons/analytics/providers/
3. Set your config:

provider = "posthog"
endpoint = "https://eu.i.posthog.com"
api_key = "phc_your_key_here"

Usage

# Track a simple event
Analytics.capture("level_completed", {"level": "tutorial", "score": 1200})

# Track with automatic duration
var stop = Analytics.start_timed("match_played", {"map": "volcano"})
# ... gameplay happens ...
stop.call({"winner": "player_2"})

# Link events to a known player (optional)
Analytics.identify("player_uuid", {"platform": "windows"})

# Force send everything now
Analytics.flush()

What shows up in PostHog

Every event arrives with the properties you pass, plus some automatic context: device ID, session ID, OS, screen size, and a timestamp. From there you can build whatever you need in PostHog's dashboard.

Some ideas to get you started:

  • Funnels to see where players drop off
  • Retention to track who comes back day after day
  • Trends to compare which levels or features get the most play
  • Breakdowns by OS, screen size, or any custom property you send

Requirements

  • Analytics Plugin for Godot (required, this provider doesn't work on its own)
  • Godot 4.x (tested on 4.3+)
  • A PostHog account (cloud free tier gives you 1M events/month)
  • GDScript only, no C# or GDExtension needed

Works with the Analytics Plugin

This provider plugs into the Analytics Plugin for Godot. The base plugin gives you the event queue, batching, offline storage, and timed events. This file adds PostHog as a destination. If you ever want to switch to another service, just swap the provider in your config. Your game code doesn't change.

License

PolyForm Shield 1.0.0 by Titang Studio.

Use it in your games, commercial or not. Modify it if you need to. You just can't redistribute or resell the plugin itself. Full terms in LICENSE.md.

Links

Purchase

Buy Now$1.00 USD or more

In order to download this tool you must purchase it at or above the minimum price of $1 USD. You will get access to the following files:

Posthog Provider for Godot Analytics Plugin - v1.0.0.zip 9.8 kB