Tracking
PIO.TrackEvent enqueues synchronously and returns immediately; a background worker flushes batches every FlushIntervalSeconds. The queue persists to on-device storage, so events survive a force-quit and flush on the next launch.
Samples~/BasicIntegration/Assets/Scripts/GuideExamples.cs
event_value field. Values must be non-negative and finite; negative, NaN, and infinite values are warned and dropped.
The rules
- Event types starting with
pio.are reserved for the SDK and hard-dropped with a warning. - Unregistered event types still flow through, with a console warning; register them in the dashboard to suppress it. Prototyping before registering is fine.
- Before
Initcompletes, or while tracking is disabled,TrackEventis a silent no-op.
Play-time heartbeat
The SDK measures foreground play time for you through the reservedpio.heartbeat event. It sends one on a flush once at least HeartbeatIntervalSeconds (default 30) of foreground time has built up.
Each heartbeat’s event_value is the foreground milliseconds since the previous heartbeat in the same session. It is an increment, not a running total, so a session’s play time is the sum of its heartbeats. Paused and backgrounded time is excluded.
Set HeartbeatEnabled to false in PioSettings to stop sending heartbeats.
Canonical helpers
PIO.Events names the common mobile-game vocabulary so event types stay consistent across your codebase.
- Levels:
LevelStart,LevelComplete,LevelFail,LevelQuit - Tutorial:
TutorialStart,TutorialStepComplete,TutorialComplete,TutorialSkip - Monetisation:
IapShown,IapPurchase,IapCancelled,AdOffered,AdStarted,AdCompleted,AdSkipped - Economy:
CurrencyEarned,CurrencySpent,ItemUnlocked,AchievementUnlocked - Engagement:
RatingPromptShown,RatingPromptAccepted,SocialShare