Keewano Unity SDK
Loading...
Searching...
No Matches
Custom Events

In addition to automatically collected events, it's recommended to add custom events to help Keewano AI Agents to better understand your gameplay and user behavior patterns specific to your product.

Good news: Unlike traditional analytics, you don't need to repeat context (level, difficulty, user_id) on every event. After ReportLevelStart(15), any ReportEnemyKilled("Orc") is automatically linked to level 15:

Traditional AnalyticsKeewano
// Game level start
SendEvent("level_start", new {
game_level = 15,
difficulty = "hard",
user_id = "abc123",
device = "iPhone13",
session = "sess_456"
});
// Level start - context set once
KeewanoSDK.ReportLevelStart(15);
KeewanoSDK.ReportDifficultySet("hard");
Definition KeewanoSDK.cs:18
// Enemy killed
SendEvent("enemy_killed", new {
enemy = "Orc",
game_level = 15, // repeated
difficulty = "hard", // repeated
user_id = "abc123", // repeated
device = "iPhone13", // repeated
session = "sess_456" // repeated
});
// Enemy killed - just the action
KeewanoSDK.ReportEnemyKilled("Orc");
// Chest opened
SendEvent("chest_opened", new {
chest_type = "Gold",
game_level = 15, // repeated
difficulty = "hard", // repeated
user_id = "abc123", // repeated
device = "iPhone13", // repeated
session = "sess_456" // repeated
});
// Chest opened - just the action
KeewanoSDK.ReportChestOpened("Gold");
// Game level end
SendEvent("level_end", new {
game_level = 15, // repeated
difficulty = "hard", // repeated
user_id = "abc123", // repeated
device = "iPhone13", // repeated
session = "sess_456" // repeated
});
// Level end
KeewanoSDK.ReportLevelEnd(15);

Adding Custom Events

To add a custom event, open the Keewano Custom Event Editor by accessing Keewano > Custom Event Editor menu item.

Custom Event Editor

In the Custom Event Editor you can add new events and their types.

Note
Please provide informative event names as they will be used by the Keewano AI Agents later during analysis in order to understand what is happening in your game.

✅ Prefer event names like OpenedMagicChest and HeroUpgraded.
⛔Avoid generic names such as CustomEvent8 or Action7.

After adding or editing custom, save the changes. Custom events are added to the KeewanoSDK class.

KeewanoSDK.ReportMainLevelStart(15); //Level #15 started
KeewanoSDK.ReportMainLevelWin(15); //User has won level #15
KeewanoSDK.ReportSetHeadHear("Boeotian helmet");

The library will create a new folder called Assets/KeewanoCustomEvents, please add it with all its content to your source control, as it contains definitions of the custom events from which the KeewanoSDK methods will be generated.

String Parameter Limits

String parameters are limited to 255 characters and will be trimmed if longer. Empty or null strings will skip the event.

Merge Conflicts

Warning
In rare cases when your game does not compile because of an unresolved merge conflict, Unity might not run the regeneration code. If such an event occurs, resolve the merge conflicts and the Keewano library will regenerate the correct custom events C# file.