Analytics
VLPlay SDK provides built-in event tracking to help you understand player behavior and game performance. [PLACEHOLDER] Events are batched and sent to VLPlay Analytics servers periodically to minimize network overhead. You can view event data in real-time on your VLPlay analytics dashboard.
[PLACEHOLDER] The SDK automatically tracks session start/end, authentication events, and purchase events. Custom events can be tracked with VLPlaySDK.analytics.track(). Each event supports up to 20 custom properties.
Automatic Events
The following events are tracked automatically when you initialize the SDK:
| Event | Trigger |
|---|---|
session_start | App foreground / page load |
session_end | App background / page unload |
login | Successful authentication |
logout | User logout |
purchase | Successful IAP |
Track Custom Events
- Android
- iOS
- Web
VLPlaySDK.analytics.track(
event = "level_complete",
properties = mapOf(
"level_id" to 5,
"score" to 12450,
"time_seconds" to 87
)
)
VLPlaySDK.analytics.track(
event: "level_complete",
properties: [
"level_id": 5,
"score": 12450,
"time_seconds": 87
]
)
VLPlaySDK.analytics.track('level_complete', {
level_id: 5,
score: 12450,
time_seconds: 87,
});
Set User Properties
// Web example — same API across platforms
VLPlaySDK.analytics.setUserProperties({
player_level: 42,
vip_tier: 'gold',
preferred_language: 'vi',
});