Table of Contents

Class Analytics

Namespace
HomaGames.HomaBelly
Assembly
HomaGames.HomaBelly.Core.dll

Class acting as the main entry point for the Analytics public API in Homa Belly.

public static class Analytics
Inheritance
Analytics
Inherited Members

Properties

CurrentLevelId

public static int CurrentLevelId { get; }

Property Value

int

InterstitialAdsWatched

[Obsolete("Direct Access to Analytics Database is deprecated, please use AnalyticsUserPropertiesProvider instead.")]
public static int InterstitialAdsWatched { get; }

Property Value

int

RewardedAdsWatched

[Obsolete("Direct Access to Analytics Database is deprecated, please use AnalyticsUserPropertiesProvider instead.")]
public static int RewardedAdsWatched { get; }

Property Value

int

Methods

BonusObjectOpened(BonusObjectType, string, string)

Invoke this method when a bonus object is opened

[PublicAPI]
[NotNull]
public static EventId BonusObjectOpened(BonusObjectType bonusObjectType, string bonusObjectName, string reward)

Parameters

bonusObjectType BonusObjectType

The type of bonus (chestroom, randombonus, bonuslevel...)

bonusObjectName string

An identifier for the bonus object (chestroom position id, name of the bonus object...)

reward string

The reward given for the bonus object

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

BonusObjectOpened(BonusObjectType, string, string, Dictionary<string, object>)

Invoke this method when a bonus object is opened

[PublicAPI]
[NotNull]
public static EventId BonusObjectOpened(BonusObjectType bonusObjectType, string bonusObjectName, string reward, Dictionary<string, object> extraParameters)

Parameters

bonusObjectType BonusObjectType

The type of bonus (chestroom, randombonus, bonuslevel...)

bonusObjectName string

An identifier for the bonus object (chestroom position id, name of the bonus object...)

reward string

The reward given for the bonus object

extraParameters Dictionary<string, object>

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

Checkpoint(string)

Invoke this method when the player reaches a certain point of interest in gameplay

[PublicAPI]
[NotNull]
public static EventId Checkpoint(string checkpointId)

Parameters

checkpointId string

A string identifying the point reached

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

Checkpoint(string, Dictionary<string, object>)

Invoke this method when the player reaches a certain point of interest in gameplay

[PublicAPI]
[NotNull]
public static EventId Checkpoint(string checkpointId, Dictionary<string, object> extraParameters)

Parameters

checkpointId string

A string identifying the point reached

extraParameters Dictionary<string, object>

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

CustomEvent(string, Dictionary<string, object>)

Tracks a fully customized event. Name and parameters can be any desired information.

[PublicAPI]
[NotNull]
public static EventId CustomEvent(string eventName, Dictionary<string, object> parameters)

Parameters

eventName string

The event name

parameters Dictionary<string, object>

Any desired custom information as a Dictionary

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

DesignEvent(string, DesignDimensions)

Tracks a design event. Name can be any desired one, and designDimensions is an optional object with up to 5 strings and a float.

[PublicAPI]
[NotNull]
public static EventId DesignEvent(string eventName, DesignDimensions designDimensions = null)

Parameters

eventName string

The event name

designDimensions DesignDimensions

Any desired custom information as a Dictionary

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

GameEnded()

Invoke this method when the player finishes the endgame

[PublicAPI]
[NotNull]
public static EventId GameEnded()

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

GameEnded(Dictionary<string, object>)

Invoke this method when the player finishes the endgame

[PublicAPI]
[NotNull]
public static EventId GameEnded(Dictionary<string, object> extraParameters)

Parameters

extraParameters Dictionary<string, object>

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

GameplayStarted()

Invoke this method every time the user starts the gameplay

[PublicAPI]
[NotNull]
public static EventId GameplayStarted()

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

GameplayStarted(Dictionary<string, object>)

Invoke this method every time the user starts the gameplay

[PublicAPI]
[NotNull]
public static EventId GameplayStarted(Dictionary<string, object> extraParameters)

Parameters

extraParameters Dictionary<string, object>

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

GetCurrentImpressionIdFor(string)

public static string GetCurrentImpressionIdFor(string placementId)

Parameters

placementId string

Returns

string

GetUserProperties()

Returns all the user properties set in the app.

public static Dictionary<string, string> GetUserProperties()

Returns

Dictionary<string, string>

IAPSuggested(string, string)

Invoke this method when a popup suggesting an IAP is shown to the user

[PublicAPI]
[NotNull]
public static EventId IAPSuggested(string popupName, string productId = null)

Parameters

popupName string

The name identifying the popup that was shown

productId string

The productId of the IAP suggested

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

IAPSuggested(string, string, Dictionary<string, object>)

Invoke this method when a popup suggesting an IAP is shown to the user

[PublicAPI]
[NotNull]
public static EventId IAPSuggested(string popupName, string productId, Dictionary<string, object> extraParameters)

Parameters

popupName string

The name identifying the popup that was shown

productId string

The productId of the IAP suggested

extraParameters Dictionary<string, object>

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

InternalPackageEvent(string, string, InternalPackageStatus)

Invoke this method when appropriate to track internal packages events as instructed by PMs.

[PublicAPI]
[NotNull]
public static EventId InternalPackageEvent(string name, string version, InternalPackageStatus status)

Parameters

name string

The name of the package being tracked

version string

The version number of the package

status InternalPackageStatus

"Installed" when a package is installed in a game, "Enabled" when a package is installed in a game and enabled, "Suggested" when the package is shown to the player, "Triggered" when the player interacts right after sending suggested event "Interacted" when the player interacts with the package (click any button)

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

InternalPackageEvent(string, string, InternalPackageStatus, Dictionary<string, object>)

Invoke this method when appropriate to track internal packages events as instructed by PMs.

[PublicAPI]
[NotNull]
public static EventId InternalPackageEvent(string name, string version, InternalPackageStatus status, Dictionary<string, object> extraParameters)

Parameters

name string

The name of the package being tracked

version string

The version number of the package

status InternalPackageStatus

"Installed" when a package is installed in a game, "Enabled" when a package is installed in a game and enabled, "Suggested" when the package is shown to the player, "Triggered" when the player interacts right after sending suggested event "Interacted" when the player interacts with the package (click any button)

extraParameters Dictionary<string, object>

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

InterstitialAdTriggered(string, AdPlacementType)

[Obsolete("Method called automatically")]
public static void InterstitialAdTriggered(string placementName, AdPlacementType adPlacementType)

Parameters

placementName string
adPlacementType AdPlacementType

InterstitialAdTriggered(string, string, AdPlacementType)

[Obsolete("Function not supported anymore.")]
public static void InterstitialAdTriggered(string adId, string placementName, AdPlacementType adPlacementType)

Parameters

adId string
placementName string
adPlacementType AdPlacementType

ItemConsumed(string, int, ItemFlowReason, EventId)

Invoke this whenever the user consumes an item

[PublicAPI]
[NotNull]
public static EventId ItemConsumed(string itemId, int itemLevel, ItemFlowReason reason, EventId triggeredByEventId = null)

Parameters

itemId string

An identifier for the consumed item

itemLevel int

The level of the consumed item

reason ItemFlowReason

Reason triggering the consumption of the item

triggeredByEventId EventId

Any previous EventId triggering this ItemConsumed. ie: ItemObtained (skin) event triggers ItemConsumed (coins)

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

ItemConsumed(string, int, ItemFlowReason, EventId, Dictionary<string, object>)

Invoke this whenever the user consumes an item

[PublicAPI]
[NotNull]
public static EventId ItemConsumed(string itemId, int itemLevel, ItemFlowReason reason, EventId triggeredByEventId, Dictionary<string, object> extraParameters)

Parameters

itemId string

An identifier for the consumed item

itemLevel int

The level of the consumed item

reason ItemFlowReason

Reason triggering the consumption of the item

triggeredByEventId EventId

Any previous EventId triggering this ItemConsumed. ie: ItemObtained (skin) event triggers ItemConsumed (coins)

extraParameters Dictionary<string, object>

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

ItemObtained(string, int, ItemFlowReason, EventId)

Invoke this whenever the user gets an item

[PublicAPI]
[NotNull]
public static EventId ItemObtained(string itemId, int itemLevel, ItemFlowReason reason, EventId triggeredByEventId = null)

Parameters

itemId string

An identifier for the obtained item

itemLevel int

The level of the obtained item

reason ItemFlowReason

Reason triggering the item transaction

triggeredByEventId EventId

Any previous EventId triggering this ItemObtained. ie: LevelCompleted event triggers ItemObtained

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

ItemObtained(string, int, ItemFlowReason, EventId, Dictionary<string, object>)

Invoke this whenever the user gets an item

[PublicAPI]
[NotNull]
public static EventId ItemObtained(string itemId, int itemLevel, ItemFlowReason reason, EventId triggeredByEventId, Dictionary<string, object> extraParameters)

Parameters

itemId string

An identifier for the obtained item

itemLevel int

The level of the obtained item

reason ItemFlowReason

Reason triggering the item transaction

triggeredByEventId EventId

Any previous EventId triggering this ItemObtained. ie: LevelCompleted event triggers ItemObtained

extraParameters Dictionary<string, object>

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

ItemUpgraded(ItemUpgradeType, string, int, ItemFlowReason, EventId)

Invoke this whenever the user upgrades an item or gets a general (non-item) upgrade

[PublicAPI]
[NotNull]
public static EventId ItemUpgraded(ItemUpgradeType upgradeType, string itemId, int itemLevel, ItemFlowReason reason, EventId triggeredByEventId = null)

Parameters

upgradeType ItemUpgradeType

'Item' if it's an item upgrade, 'Upgrade' for general non-item upgrades

itemId string

The identifier for the upgraded item or general upgrade

itemLevel int

The level of the upgraded item

reason ItemFlowReason

Reason triggering the upgrade

triggeredByEventId EventId

Any previous EventId triggering this ItemUpgraded. ie: ResourceFlowEvent (sink) triggers ItemUpgraded

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

ItemUpgraded(ItemUpgradeType, string, int, ItemFlowReason, EventId, Dictionary<string, object>)

Invoke this whenever the user upgrades an item or gets a general (non-item) upgrade

[PublicAPI]
[NotNull]
public static EventId ItemUpgraded(ItemUpgradeType upgradeType, string itemId, int itemLevel, ItemFlowReason reason, EventId triggeredByEventId, Dictionary<string, object> extraParameters)

Parameters

upgradeType ItemUpgradeType

'Item' if it's an item upgrade, 'Upgrade' for general non-item upgrades

itemId string

The identifier for the upgraded item or general upgrade

itemLevel int

The level of the upgraded item

reason ItemFlowReason

Reason triggering the upgrade

triggeredByEventId EventId

Any previous EventId triggering this ItemUpgraded. ie: ResourceFlowEvent (sink) triggers ItemUpgraded

extraParameters Dictionary<string, object>

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

LevelCompleted()

Invoke this every time the player completes the level

[PublicAPI]
[NotNull]
public static EventId LevelCompleted()

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

LevelCompleted(Dictionary<string, object>)

Invoke this every time the player completes the level

[PublicAPI]
[NotNull]
public static EventId LevelCompleted(Dictionary<string, object> extraParameters)

Parameters

extraParameters Dictionary<string, object>

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

LevelFailed(string, float?)

Invoke this every time the player fails the level

[PublicAPI]
[NotNull]
public static EventId LevelFailed(string reason, float? percentCompleted = null)

Parameters

reason string

A string providing the reason for the level failure.

percentCompleted float?

(Optional) A float representing the percentage of the level that was completed before failure. The value should be between 0 and 1, where 0 means no progress and 1 means the level was fully completed.

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

LevelFailed(string, float?, Dictionary<string, object>)

Invoke this every time the player fails the level

[PublicAPI]
[NotNull]
public static EventId LevelFailed(string reason, float? percentCompleted, Dictionary<string, object> extraParameters)

Parameters

reason string

A string providing the reason for the level failure.

percentCompleted float?

(Optional) A float representing the percentage of the level that was completed before failure. The value should be between 0 and 1, where 0 means no progress and 1 means the level was fully completed.

extraParameters Dictionary<string, object>

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

LevelStarted(int)

Invoke this every time the player starts a level

[PublicAPI]
[NotNull]
public static EventId LevelStarted(int levelId)

Parameters

levelId int

A sequential number for the level. Please start at 1.

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

LevelStarted(int, Dictionary<string, object>)

Invoke this every time the player starts a level

[PublicAPI]
[NotNull]
public static EventId LevelStarted(int levelId, Dictionary<string, object> extraParameters)

Parameters

levelId int

A sequential number for the level. Please start at 1.

extraParameters Dictionary<string, object>

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

MainMenuLoaded()

Invoke this method every time your Main Menu screen is loaded

[PublicAPI]
[NotNull]
public static EventId MainMenuLoaded()

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

MainMenuLoaded(Dictionary<string, object>)

Invoke this method every time your Main Menu screen is loaded

[PublicAPI]
[NotNull]
public static EventId MainMenuLoaded(Dictionary<string, object> extraParameters)

Parameters

extraParameters Dictionary<string, object>

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

MenuClosed(string)

Invoke this method when the user leaves a menu.

[PublicAPI]
[NotNull]
public static EventId MenuClosed(string menuName)

Parameters

menuName string

The name of the menu

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

MenuClosed(string, Dictionary<string, object>)

Invoke this method when the user leaves a menu.

[PublicAPI]
[NotNull]
public static EventId MenuClosed(string menuName, Dictionary<string, object> extraParameters)

Parameters

menuName string

The name of the menu

extraParameters Dictionary<string, object>

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

MenuOpened(string)

Invoke this method when the user enters a menu.

[PublicAPI]
[NotNull]
public static EventId MenuOpened(string menuName)

Parameters

menuName string

The name of the menu

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

MenuOpened(string, Dictionary<string, object>)

Invoke this method when the user enters a menu.

[PublicAPI]
[NotNull]
public static EventId MenuOpened(string menuName, Dictionary<string, object> extraParameters)

Parameters

menuName string

The name of the menu

extraParameters Dictionary<string, object>

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

MissionCompleted(string, string)

Invoke this method when a mission is completed

[PublicAPI]
[NotNull]
public static EventId MissionCompleted(string missionId, string reward)

Parameters

missionId string

The ID for the mission

reward string

The reward given for completing the mission

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

MissionCompleted(string, string, Dictionary<string, object>)

Invoke this method when a mission is completed

[PublicAPI]
[NotNull]
public static EventId MissionCompleted(string missionId, string reward, Dictionary<string, object> extraParameters)

Parameters

missionId string

The ID for the mission

reward string

The reward given for completing the mission

extraParameters Dictionary<string, object>

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

MissionFailed(string)

Invoke this method when a mission is skipped or failed

[PublicAPI]
[NotNull]
public static EventId MissionFailed(string missionId)

Parameters

missionId string

The ID for the mission

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

MissionFailed(string, Dictionary<string, object>)

Invoke this method when a mission is skipped or failed

[PublicAPI]
[NotNull]
public static EventId MissionFailed(string missionId, Dictionary<string, object> extraParameters)

Parameters

missionId string

The ID for the mission

extraParameters Dictionary<string, object>

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

MissionStarted(string)

Invoke this method when a mission is open for a user

[PublicAPI]
[NotNull]
public static EventId MissionStarted(string missionId)

Parameters

missionId string

The ID for the mission

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

MissionStarted(string, Dictionary<string, object>)

Invoke this method when a mission is open for a user

[PublicAPI]
[NotNull]
public static EventId MissionStarted(string missionId, Dictionary<string, object> extraParameters)

Parameters

missionId string

The ID for the mission

extraParameters Dictionary<string, object>

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

OnApplicationPause(bool)

public static void OnApplicationPause(bool pause)

Parameters

pause bool

ResourceFlowEvent(ResourceFlowType, string, float, float, ResourceFlowReason, EventId)

Invoke this whenever there's a resource flow (source/sink) event (NO itemType/itemId required).

[PublicAPI]
[NotNull]
public static EventId ResourceFlowEvent(ResourceFlowType flowType, string currency, float flowAmount, float finalAmount, ResourceFlowReason flowReason, EventId triggeredByEventId = null)

Parameters

flowType ResourceFlowType

Source when user obtains some resource, or Sink when user spends some resource

currency string

Resource name

flowAmount float

Quantity affected by the flow

finalAmount float

Final amount after the flow transaction

flowReason ResourceFlowReason

Reason triggering the flow transaction

triggeredByEventId EventId

Any previous EventId triggering this ResourceFlowEvent. ie: LevelCompleted event triggers ResourceFlowEvent

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

ResourceFlowEvent(ResourceFlowType, string, float, float, string, string, ResourceFlowReason, EventId)

Invoke this whenever there's a resource flow (source/sink) event.

[PublicAPI]
[NotNull]
public static EventId ResourceFlowEvent(ResourceFlowType flowType, string currency, float flowAmount, float finalAmount, string itemType, string itemId, ResourceFlowReason flowReason, EventId triggeredByEventId = null)

Parameters

flowType ResourceFlowType

Source when user obtains some resource, or Sink when user spends some resource

currency string

Resource name

flowAmount float

Quantity affected by the flow

finalAmount float

Final amount after the flow transaction

itemType string

Type of the Item

itemId string

An identifier for the item

flowReason ResourceFlowReason

Reason triggering the flow transaction

triggeredByEventId EventId

Any previous EventId triggering this ResourceFlowEvent. ie: LevelCompleted event triggers ResourceFlowEvent

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

ResourceFlowEvent(ResourceFlowType, string, float, float, string, string, ResourceFlowReason, EventId, Dictionary<string, object>)

Invoke this whenever there's a resource flow (source/sink) event.

[PublicAPI]
[NotNull]
public static EventId ResourceFlowEvent(ResourceFlowType flowType, string currency, float flowAmount, float finalAmount, string itemType, string itemId, ResourceFlowReason flowReason, EventId triggeredByEventId, Dictionary<string, object> extraParameters)

Parameters

flowType ResourceFlowType

Source when user obtains some resource, or Sink when user spends some resource

currency string

Resource name

flowAmount float

Quantity affected by the flow

finalAmount float

Final amount after the flow transaction

itemType string

Type of the Item

itemId string

An identifier for the item

flowReason ResourceFlowReason

Reason triggering the flow transaction

triggeredByEventId EventId

Any previous EventId triggering this ResourceFlowEvent. ie: LevelCompleted event triggers ResourceFlowEvent

extraParameters Dictionary<string, object>

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

RewardedAdSuggested(string)

Invoke this method whenever a rewarded offer is suggested to the player.

[PublicAPI]
[NotNull]
public static EventId RewardedAdSuggested(string placementName)

Parameters

placementName string

Please follow the nomenclature in the relevant document

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

RewardedAdSuggested(string, Dictionary<string, object>)

Invoke this method whenever a rewarded offer is suggested to the player.

[PublicAPI]
[NotNull]
public static EventId RewardedAdSuggested(string placementName, Dictionary<string, object> extraParameters)

Parameters

placementName string

Please follow the nomenclature in the relevant document

extraParameters Dictionary<string, object>

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

RewardedAdTriggered(string, AdPlacementType)

[Obsolete("Method called automatically")]
public static void RewardedAdTriggered(string placementName, AdPlacementType adPlacementType)

Parameters

placementName string
adPlacementType AdPlacementType

RewardedAdTriggered(string, string, AdPlacementType)

[Obsolete("Method called automatically")]
public static void RewardedAdTriggered(string placementId, string placementName, AdPlacementType adPlacementType)

Parameters

placementId string
placementName string
adPlacementType AdPlacementType

SetUserProperty(string, object)

Sets a user property to a given value. Up to 25 property names are supported. Once set, property values persist throughout the app lifecycle and across sessions.

[PublicAPI]
public static void SetUserProperty(string name, object value)

Parameters

name string

The name of the property to set. Should contain 1 to 24 alphanumeric characters or underscores and must start with an alphabetic character.

value object

The value of the property. Values can be up to 36 characters long. Setting the value to null removes the property.

TutorialStepCompleted()

Invoke this method every time a tutorial step is completed. Invoking it twice for the same step is harmless, as only the very first one will be taken into account.

[PublicAPI]
[NotNull]
public static EventId TutorialStepCompleted()

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

TutorialStepFailed()

When the player does not execute the asked behavior in the current tutorial step

[PublicAPI]
[NotNull]
public static EventId TutorialStepFailed()

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

TutorialStepFailed(Dictionary<string, object>)

When the player does not execute the asked behavior in the current tutorial step

[PublicAPI]
[NotNull]
public static EventId TutorialStepFailed(Dictionary<string, object> extraParameters)

Parameters

extraParameters Dictionary<string, object>

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers

TutorialStepStarted(int)

Invoke this method every time a tutorial step is started. Invoking it twice for the same step is harmless, as only the very first one will be taken into account.

[PublicAPI]
[NotNull]
public static EventId TutorialStepStarted(int step)

Parameters

step int

The tutorial step

Returns

EventId

EventId to be referenced, if necessary, in later events as triggers