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. - An event you send with an unregistered type is still accepted, with a console warning. Register the types your decisions or rewards need.
- 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
Send only the events your decisions or rewards use.PIO.Events provides helper names for those events; the list is not a collection checklist.
- 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