Godot Plugin
The Godot 4.4 plugin provides a minimal API to initialize, log events, and submit/fetch scores. It also handles player ID derivation and HMAC signing.
Install
- Copy the
addons/gamelyticsfolder into your project. - Enable the plugin in Project > Plugins.
- Set your Game Key and Secret in the plugin settings.
Initialize
extends Node
var glx = preload("res://addons/glx.gd").new()
func _ready():
glx.init("YOUR_GAME_KEY", "YOUR_GAME_SECRET") # auto-logs session_start
glx.log_event("tutorial_start", {"level": 1})
Common calls
# Log a custom event
glx.log_event("achievement_unlocked", {"level": 3, "badge": "novice"})
# Submit a score
glx.log_score(4710, {"mode": "arcade", "map": "intro_forest"})
# Fetch scores (teaser)
# glx.fetch_scores(player_id="", page=1, rows=20, time_range="all_time")
Configuration tips
- Use
set_credentials()at runtime to rotate keys if needed. - Prefer UTC timestamps; the portal displays local time to users.
- Send compact metadata; index hot keys you’ll filter on.
Full plugin signals, error handling, and advanced methods (e.g., retries, batching) are available to members.
Sign up to unlock.