Tracking Events
All manual tracking methods accept typed event objects and return bool (true on success).
Automatic Events
These events are tracked by the SDK automatically once initialized:
| Event | Trigger | Dashboard |
|---|---|---|
session_start | SDK initializes / app resumes | Engagement |
session_stop | App backgrounds / shuts down | Engagement |
| FPS samples | Every frame (via GRMetricsCollector) | Technical |
| Memory samples | Sampled locally, batched to server | Technical |
Gameplay Events
using GameRebellionSdk.Unity;
// Feature usage (Engagement dashboard)
GameRebellion.TrackFeatureUse(new GrFeatureUseEvent
{
Type = "ui",
Name = "inventory",
Category = "gameplay",
CompletionStatus = "opened"
});
// Progression (Progression dashboard)
GameRebellion.TrackProgression(new GrProgressionEvent
{
Type = "level",
Status = "complete",
Progression01 = "world_1",
Progression02 = "level_5",
Score = 1200,
CompletionTime = 245.0,
Difficulty = "normal"
});
// Level up
GameRebellion.TrackLevelUp(new GrLevelUpEvent { Level = 5 });
// Achievement
GameRebellion.TrackAchievement(new GrAchievementEvent { Id = "dragon_slayer" });
Monetization Events
// In-app purchase
GameRebellion.TrackTransaction(new GrTransactionEvent
{
Amount = 4.99,
Currency = "USD",
Type = "iap",
Description = "Premium Sword",
Status = "success",
UsdValue = 4.99
});
// Ad impression
GameRebellion.TrackAdView(new GrAdViewEvent
{
AdType = "rewarded",
AdPlacement = "double_coins",
AdSdkName = "AdMob",
Category = "video"
});
// Rewarded ad completion
GameRebellion.TrackAdReward(new GrAdRewardEvent
{
AdType = "rewarded",
AdPlacement = "double_coins",
RewardType = "coins",
RewardAmount = 100,
RewardCurrency = "gold",
AdSdkName = "AdMob"
});
Social Events
GameRebellion.TrackFriendInvite(new GrFriendInviteEvent
{
InviteMethod = "share_link",
InviteCount = 1
});
GameRebellion.TrackGroupJoin(new GrGroupJoinEvent
{
GroupId = "guild-42",
GroupName = "Dragon Slayers",
GroupType = "guild",
GroupSize = 25
});
GameRebellion.TrackChatMessage(new GrChatMessageEvent
{
ChatType = "guild",
MessageLength = 42,
MessageType = "text"
});
GameRebellion.TrackVoiceCallStart(new GrVoiceCallStartEvent
{
Type = "group",
CallId = "call-uuid",
ParticipantCount = 4
});
GameRebellion.TrackVoiceCallStop(new GrVoiceCallStopEvent
{
CallId = "call-uuid",
StopReason = "ended"
});
Error and Log Events
try
{
FetchLeaderboard();
}
catch (System.Exception ex)
{
GameRebellion.TrackLog(new GrLogEvent
{
Type = "error",
Category = "network",
Message = ex.Message,
ErrorCode = "LEADERBOARD_FETCH_FAIL",
FeatureName = "leaderboard",
StackTrace = ex.StackTrace,
ExceptionType = ex.GetType().Name,
IsUserAffected = true
});
}
Custom Events
For events not covered by the typed methods:
[System.Serializable]
public class QuestPayload
{
public string quest_id;
public string npc;
}
var payload = new QuestPayload { quest_id = "main_quest_3", npc = "merchant" };
string json = JsonUtility.ToJson(payload);
GameRebellion.TrackEvent("quest_accepted", json);
note
Unity's JsonUtility requires [Serializable] classes — anonymous types are not supported.