Analytics Events API
Track player behavior, game events, and custom metrics to understand how players interact with your game
Overview
Analytics System Features
Track any custom events with flexible properties to understand player behavior
📊 Core Features
- • Track any custom events (level_complete, item_purchased, etc.)
- • Flexible event properties with nested objects
- • Automatic batching and offline queuing
- • Real-time dashboard analytics
- • Player segmentation and retention metrics
- • JSON data with UTF-8 encoding
- • Automatic compression during transfer
Send Analytics Events
POST /v1/player/events
Send one or more analytics events with custom properties
Single Event Request
Batch Events Request
Response Format
Event Structure
Event Fields and Properties
Understanding event structure and property limitations
Required Fields
event- Event name (string, max 50 chars)timestamp- When event occurred (ISO 8601)
Optional Fields
properties- Custom data (object, max 512B)session_id- Group related events (string)
Event Properties Examples
Event Batching
Optimizing Event Delivery
Best practices for sending events efficiently
✅ Best Practices
- • Batch events: send up to 100 events per request
- • Queue events locally during offline periods
- • Use session IDs to group related events
- • Implement exponential backoff for retries
❌ Common Mistakes
- • Sending each event in separate requests
- • Missing error handling for failed events
- • Tracking too many granular events
SDK Integration Examples
Track Events with StatPotion SDKs
Simple integration examples for Unity and Godot
Complete Event Tracking Examples
Common Event Types
Recommended Events for Games
Standard events that provide valuable player insights
🎮 Gameplay Events
level_start- Player begins a levellevel_complete- Player finishes a levellevel_fail- Player fails/quits a levelgame_over- Game session endsachievement_unlock- Player earns achievement
💰 Monetization Events
item_purchase- Player buys in-game itemcurrency_earn- Player gains currencycurrency_spend- Player spends currencyad_view- Player watches advertisementshop_visit- Player visits shop
📊 Engagement Events
session_start- Player starts game sessionsession_end- Player ends game sessiontutorial_step- Player progresses in tutorialsettings_change- Player modifies settingssocial_share- Player shares content
🔧 Technical Events
error_occurred- Game error or crashperformance_metric- FPS, load timesfeature_usage- Player uses specific featuredevice_info- Device/platform informationapp_install- First time app launch
Troubleshooting Analytics Issues
Problem: Events not appearing in dashboard
Solution: Check that events are being sent successfully.