Event Tracking Reference
Events are the core of Quest Data. Track player actions, game state, monetization, and performance. The SDK handles batching, offline caching, and retry logic automatically.
Event API
Section titled “Event API”# Track a single eventQuestData.track("event_name", { "property1": "value1", "property2": 42, "property3": true})
# Events are queued immediately, sent in batches every 10s# Or immediately when 10+ events queuedBuilt-In Events
Section titled “Built-In Events”Game Lifecycle
Section titled “Game Lifecycle”# Game startedQuestData.track("game_start", { "version": "1.2.0", "platform": OS.get_name(), "language": TranslationServer.get_locale()})
# Session ended (auto-tracked if app closes)QuestData.track("game_end", { "duration_seconds": 3600, "total_revenue_session": 9.99})Progression
Section titled “Progression”# Recommended: Use helper functionsQuestData.start_progression("level_5", "hard")QuestData.complete_progression("level_5", 1000)QuestData.fail_progression("level_5", "out_of_moves")
# Alternative: Raw events (no automatic duration)QuestData.track("level_start", { "level": 5, "difficulty": "hard", "attempt": 2})Monetization
Section titled “Monetization”# Recommended: Use helper functionQuestData.track_purchase("starter_pack", 4.99, "USD", { "transaction_id": "txn_abc123"})
# Custom monetization eventsQuestData.track("shop_opened", { "section": "weapons", "items_available": 12})Errors & Crashes
Section titled “Errors & Crashes”# Recommended: Use helper function (auto stack trace + flight recorder)QuestData.track_error("NullReference", "Player is null in _physics_process")
# Remote logging (different system — for debugging, not crash analytics)QuestData.log_error("Memory pressure detected", {"free_mb": 45})Performance (Automatic)
Section titled “Performance (Automatic)”The SDK auto-tracks performance — no code required. Three lifecycle events feed the Performance dashboard:
| Event | When | Properties |
|---|---|---|
session_start | SDK init | platform, device_model, cpu_cores, gpu_name, total_ram, app_version |
session_ping | Every 60s during play | fps, ram_bytes, scene (live snapshot at ping time) |
session_end | On WM_CLOSE_REQUEST | duration, min_fps, avg_fps, max_fps, max_ram, fps_samples, device_model |
session_ping enables mid-session telemetry (long sessions, mobile background, crashes that prevent session_end). FPS and RAM are sampled live at ping time; the dashboard aggregates them for time-series charts and per-device breakdown.
Disable auto-pings by setting Project Settings → quest_data/heartbeat_interval to 0.
# Optional: extra context for hot spotsQuestData.track("lag_spike", { "frame_drop": 45, "duration_frames": 12, "location": "boss_arena"})UI Interactions
Section titled “UI Interactions”QuestData.track_ui(screen_name: String, element_name: String, action: String = "click")Helper for tracking UI interactions. Wraps track("ui_interaction", { screen, element, action }) — consistent property names across screens, ready to feed the Engagement dashboard’s UI heatmap.
| Parameter | Type | Default | Description |
|---|---|---|---|
screen_name | String | required | The current screen / page (e.g. "main_menu", "shop") |
element_name | String | required | Element identifier (e.g. "play_button", "sword_item") |
action | String | "click" | Interaction type — "click", "view", "hover", "swipe", … |
# Button pressesQuestData.track_ui("main_menu", "play_button") # default action = "click"QuestData.track_ui("settings", "music_volume", "drag")
# Element views (e.g. shop item came into viewport)QuestData.track_ui("shop", "starter_pack", "view")
# Tab switchesQuestData.track_ui("inventory", "weapons_tab", "click")screen_name and element_name are required and must be non-empty — the SDK skips the call with a warning otherwise.
Social & Features
Section titled “Social & Features”# Recommended: Use helper functionsQuestData.unlock_achievement("first_boss_defeat")QuestData.submit_score("weekly_boss_speedrun", 1250)
# Ad watched (custom event — no helper function)QuestData.track("ad_watched", { "ad_type": "rewarded", "reward_amount": 100, "reward_type": "coins"})Custom Events
Section titled “Custom Events”Track anything specific to your game:
# Custom event: boss defeatedQuestData.track("boss_defeated", { "boss_id": "dragon_lord", "boss_name": "Dragon Lord", "level": 12, "attempts": 3, "damage_taken": 45, "time_spent_seconds": 600})
# Custom event: resource earnedQuestData.track("resource_earned", { "resource_type": "gold", "amount": 500, "source": "quest_completion"})
# Custom event: feature usedQuestData.track("feature_used", { "feature": "daily_challenge", "completed": true, "difficulty": "normal"})Event Properties
Section titled “Event Properties”All properties are optional. Common properties for all events:
{ "timestamp": 1712415000, "player_id": "player123", "session_id": "sess_xyz", "version": "1.2.0", "platform": "iOS"}Event Limits
Section titled “Event Limits”| Property | Limit | Notes |
|---|---|---|
| Properties per event | 50 | More = bigger payloads |
| Property value size | 1KB | Don’t pass entire objects |
| Event size | 64KB | Total payload per batch |
| Queue size | 10,000 events | Older events dropped if exceeded |
Batch Behavior
Section titled “Batch Behavior”Events are automatically batched:
- Trigger 1: 10+ events queued → send immediately
- Trigger 2: 10 seconds elapsed → send batch
- Offline: Events saved to
user://quest_queue.save - Retry: Failed batches retry every 30s (max 5 times)
# Check queue statusvar queue_size = QuestData.get_queue_size()
# Force flushQuestData.flush()Best Practices
Section titled “Best Practices”- Keep properties small — use IDs not full objects
- Be consistent — use same event names always
- Don’t track PII — avoid names, emails, addresses
- Sample high-frequency events — don’t track every frame
- Test locally before release
Troubleshooting
Section titled “Troubleshooting”Events not appearing?
- Check API key:
ProjectSettings.get_setting("quest_data/api_key") - Wait 15 seconds for batching
- Force flush:
QuestData.flush() - Check Configuration > Logs in dashboard
Events buffering?
- Check internet connection
- SDK retries automatically
- Events persist to disk on crash
Next Steps
Section titled “Next Steps”- Godot SDK Setup — Installation and configuration
- Progression Tracking — Level starts, completions, failures
- Error Tracking — Crashes with stack traces
- Purchase Tracking — Revenue and IAP
- Remote Config & Game Data — Feature flags, balance tables
- Leaderboards — Global rankings
- Achievements — Unlock tracking
- Cloud Saves — Save/load with versioning
- Players & Segments — Tags and properties
- Remote Logging — Debug logs