Player Identity
GameRebellion uses a layered identity system to track players across sessions and devices.
Identity Layers
| Layer | Source | Persistence | Cross-Device |
|---|---|---|---|
device_id | Auto-generated UUID | Per-device, persisted to disk | No |
player_id | Set by your game | Custom — you control it | Yes |
idfa / gaid | OS advertising ID | Resettable by player | No |
Setting Player ID
Call TrackEvent with a login event or set the player ID in your initialization flow:
// After the player authenticates in your game:
GameRebellion.TrackEvent("login", JsonUtility.ToJson(new { player_id = "player-12345" }));
For S2S integrations, include player_id in the identifiers block:
{
"identifiers": {
"player_id": "player-12345"
}
}
Best Practices
- Set player ID as early as possible after authentication to link all subsequent events.
- Use a stable, unique identifier — your backend user ID is ideal.
- Never use PII (email, phone) as the player ID.
- Anonymous players still get a
device_idfor per-device analytics.