Analytics and Events

How to implement Homa Belly analytics in your game.

This page lists all the analytics events you need to implement in your game by category. All the events are invoked using static methods from the HomaGames.HomaBelly.Analytics class. See the in-code documentation for further details on the methods and their parameters.

Each method retuns an EventId object, that can be then fed to other analytics methods to link events together. For example to track if the user earns coins because they completed a level.

Table of Contents

General events

Menus

Every time you main menu is loaded, either at the start of the game, or when player comes back from gameplay, you need to call the Aanlytics.MainMenuLoaded method.
If your game's main menu is shown at the start of every level (typically in runner games), then you will have to call the method between every level.

If you have sub menus in your game, for IAPs or cosmetics for example, you will need to call Analytics.MenuOpened and Analytics.MenuClosed when the player opens/closes those menus respectively.

Gameplay

Whenever the player switches from menus to gameplay, you need to call Analytics.GameplayStarted.

 


Game progression related events

[Linear] Level progression and tutorial

When the player starts a level, you have to call Analytics.LevelStarted, with the ID of the level. When the level finishes, if the player fails or completes the level, you will need to call Analytics.LevelFailed or Analytics.LevelCompleted respectively.

If your game features a tutorial, you will need to implement the same system for each step of the tutorial, with Analytics.TutorialStepStarted, Analytics.TutorialStepFailed and Analytics.TutorialStepCompleted.

[Non-Linear] Checkpoints and missions

If your game features non-linear progression, you can track non-repeatable progression markers using Analytics.Checkpoint. For example when the player finds a significant item hidden in an open world. 

If your game features missions, you will need to track them the same way you do with levels, with Analytics.MissionStarted, Analytics.MissionCompleted and Analytics.MissionFailed. You will need to provide both an identifier for the mission, and what the reward is if the player completes the mission.

End of the game

If your game is not endless, when the player completely finishes the game, and there are no more level for them to play, you will need to call Analytics.GameEnded.

 


Economy related events

Currencies

If your games involves any type of currency, like gems or coins, you will need to call Analytics.ResourceFlowEvent every time the player gains or loses some of it.

If the player loses currency, use "ResourceFlowType.Sink", and be sure to put a positive value as flow amount. 

If the player earns or loses currency during gameplay, you must pass "ResourceFlowReason.Progression" as flow reason, and an event ID describing when it happened. If the user earnt money during gameplay, put the event ID returned by the "Analytics.LevelStarted" method, and if it is a reward for completing the level, use the one returned by "Analytics.LevelCompleted".

Do not call this method every time the player picks up a coin, but rather once every level or every checkpoint. 

Upgrades and items

If game has upgrades, on items or not, you need to track them by calling Analytics.ItemUpgraded. Use the first parameter to describe if an item has been upgraded, or if the upgrade is general.

if players can obtain items in your game, gameplay related or cosmetics, you must call the Analytics.ItemObtained event. If they consume an item, you must call Analytics.ItemConsumed.

Bonuses

Call the Analytics.BonusObjectOpened if the player earns acces to bonus content. It can be a chest room, a bonus roulette, a bonus level or other.

 


Ads related events

This section is applicable only to games that have implemented ads. Whenever you propose an ad to the user, you must call Analytics.RewardedAdSuggested. This can be by showing a button, but also using a gameplay element, like a trigger the player must interact with. In that case, call that method whenever the player has access to the trigger.

The Analytics.RewardedAdTriggered and Analytics.InterstitialAdTriggered methods are called automatically. You must not call them yourself.

 


In App Purchases related events

This section is applicable only to games that have implemented In App Purchases. Whenever you show an IAP button in your game, you must call Analytics.IAPSuggested. If for example you have an IAP menu with 4 different offers, you must call the methods 4 times.

 


Other events

If you want to track player behaviour outside of the events mentioned above, you have 2 options: Analytics.DesignEvent and Analytics.CustomEvent.

Design events provide a simple and flexible solution to measure engagement with specific systems/funnels.They can be analysed using GameAnalytics.

Custom events are better suited to pass complex data to analyse player behaviour, but require ad-hoc work on the Homa Analytics side. Do not use them unless specifically asked to by your Project Manager. Those events are not sent to GameAnalytics.