Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/coelhucas/godot-posthog
📊 Godot 4.X integration for PostHog API
https://github.com/coelhucas/godot-posthog
analytics godot godot-engine posthog
Last synced: about 2 months ago
JSON representation
📊 Godot 4.X integration for PostHog API
- Host: GitHub
- URL: https://github.com/coelhucas/godot-posthog
- Owner: coelhucas
- License: mit
- Created: 2024-02-08T17:35:42.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-02-08T19:02:43.000Z (12 months ago)
- Last Synced: 2024-12-16T14:05:01.042Z (about 2 months ago)
- Topics: analytics, godot, godot-engine, posthog
- Language: GDScript
- Homepage:
- Size: 7.81 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Godot PostHog
Integration of PostHog API for Godot 4.X
Made on top of [@WolfgangSenff](https://github.com/WolfgangSenff)'s [PostHogPlugin](https://github.com/WolfgangSenff/KylesGodotPlugins/blob/master/PostHogPlugin/)## Usage
Put `posthog/` folder inside `res://addons/`
Once the plugin is added, your project will get a new global setting, `Posthog API Key`
![image](https://github.com/WolfgangSenff/KylesGodotPlugins/assets/28108272/e5a277dd-9490-49ec-b2f5-8e4d6e16737f)Set it to your API Key and then you'll be able to send your events as follows:
```gdscript
var _ev := PostHogEvent.new()
_ev.event_name = "Your event name"
_ev.distinct_id = "an unique identifier"
_ev.properties = { "some_key": "a value", "another_key": "value" }PostHog.send_event(_ev)
```A `timestamp` is optional, will be set to the server one if none is sent.
An example of a custom event send to their analytics dashboard:
![image](https://github.com/coelhucas/godot-posthog/assets/28108272/98da1a88-159a-46b3-a04c-a633226922aa)