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
InterstitialAdsWatched
[Obsolete("Direct Access to Analytics Database is deprecated, please use AnalyticsUserPropertiesProvider instead.")]
public static int InterstitialAdsWatched { get; }
Property Value
RewardedAdsWatched
[Obsolete("Direct Access to Analytics Database is deprecated, please use AnalyticsUserPropertiesProvider instead.")]
public static int RewardedAdsWatched { get; }
Property Value
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
bonusObjectTypeBonusObjectTypeThe type of bonus (chestroom, randombonus, bonuslevel...)
bonusObjectNamestringAn identifier for the bonus object (chestroom position id, name of the bonus object...)
rewardstringThe 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
bonusObjectTypeBonusObjectTypeThe type of bonus (chestroom, randombonus, bonuslevel...)
bonusObjectNamestringAn identifier for the bonus object (chestroom position id, name of the bonus object...)
rewardstringThe reward given for the bonus object
extraParametersDictionary<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
checkpointIdstringA 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
checkpointIdstringA string identifying the point reached
extraParametersDictionary<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
eventNamestringThe event name
parametersDictionary<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
eventNamestringThe event name
designDimensionsDesignDimensionsAny 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
extraParametersDictionary<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
extraParametersDictionary<string, object>
Returns
- EventId
EventId to be referenced, if necessary, in later events as triggers
GetCurrentImpressionIdFor(string)
public static string GetCurrentImpressionIdFor(string placementId)
Parameters
placementIdstring
Returns
GetUserProperties()
Returns all the user properties set in the app.
public static Dictionary<string, string> GetUserProperties()
Returns
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
popupNamestringThe name identifying the popup that was shown
productIdstringThe 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
popupNamestringThe name identifying the popup that was shown
productIdstringThe productId of the IAP suggested
extraParametersDictionary<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
namestringThe name of the package being tracked
versionstringThe version number of the package
statusInternalPackageStatus"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
namestringThe name of the package being tracked
versionstringThe version number of the package
statusInternalPackageStatus"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)
extraParametersDictionary<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
placementNamestringadPlacementTypeAdPlacementType
InterstitialAdTriggered(string, string, AdPlacementType)
[Obsolete("Function not supported anymore.")]
public static void InterstitialAdTriggered(string adId, string placementName, AdPlacementType adPlacementType)
Parameters
adIdstringplacementNamestringadPlacementTypeAdPlacementType
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
itemIdstringAn identifier for the consumed item
itemLevelintThe level of the consumed item
reasonItemFlowReasonReason triggering the consumption of the item
triggeredByEventIdEventIdAny 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
itemIdstringAn identifier for the consumed item
itemLevelintThe level of the consumed item
reasonItemFlowReasonReason triggering the consumption of the item
triggeredByEventIdEventIdAny previous EventId triggering this ItemConsumed. ie: ItemObtained (skin) event triggers ItemConsumed (coins)
extraParametersDictionary<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
itemIdstringAn identifier for the obtained item
itemLevelintThe level of the obtained item
reasonItemFlowReasonReason triggering the item transaction
triggeredByEventIdEventIdAny 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
itemIdstringAn identifier for the obtained item
itemLevelintThe level of the obtained item
reasonItemFlowReasonReason triggering the item transaction
triggeredByEventIdEventIdAny previous EventId triggering this ItemObtained. ie: LevelCompleted event triggers ItemObtained
extraParametersDictionary<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
upgradeTypeItemUpgradeType'Item' if it's an item upgrade, 'Upgrade' for general non-item upgrades
itemIdstringThe identifier for the upgraded item or general upgrade
itemLevelintThe level of the upgraded item
reasonItemFlowReasonReason triggering the upgrade
triggeredByEventIdEventIdAny 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
upgradeTypeItemUpgradeType'Item' if it's an item upgrade, 'Upgrade' for general non-item upgrades
itemIdstringThe identifier for the upgraded item or general upgrade
itemLevelintThe level of the upgraded item
reasonItemFlowReasonReason triggering the upgrade
triggeredByEventIdEventIdAny previous EventId triggering this ItemUpgraded. ie: ResourceFlowEvent (sink) triggers ItemUpgraded
extraParametersDictionary<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
extraParametersDictionary<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
reasonstringA string providing the reason for the level failure.
percentCompletedfloat?(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
reasonstringA string providing the reason for the level failure.
percentCompletedfloat?(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.
extraParametersDictionary<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
levelIdintA 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
levelIdintA sequential number for the level. Please start at 1.
extraParametersDictionary<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
extraParametersDictionary<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
menuNamestringThe 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
menuNamestringThe name of the menu
extraParametersDictionary<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
menuNamestringThe 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
menuNamestringThe name of the menu
extraParametersDictionary<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
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
missionIdstringThe ID for the mission
rewardstringThe reward given for completing the mission
extraParametersDictionary<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
missionIdstringThe 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
missionIdstringThe ID for the mission
extraParametersDictionary<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
missionIdstringThe 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
missionIdstringThe ID for the mission
extraParametersDictionary<string, object>
Returns
- EventId
EventId to be referenced, if necessary, in later events as triggers
OnApplicationPause(bool)
public static void OnApplicationPause(bool pause)
Parameters
pausebool
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
flowTypeResourceFlowTypeSourcewhen user obtains some resource, orSinkwhen user spends some resourcecurrencystringResource name
flowAmountfloatQuantity affected by the flow
finalAmountfloatFinal amount after the flow transaction
flowReasonResourceFlowReasonReason triggering the flow transaction
triggeredByEventIdEventIdAny 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
flowTypeResourceFlowTypeSourcewhen user obtains some resource, orSinkwhen user spends some resourcecurrencystringResource name
flowAmountfloatQuantity affected by the flow
finalAmountfloatFinal amount after the flow transaction
itemTypestringType of the Item
itemIdstringAn identifier for the item
flowReasonResourceFlowReasonReason triggering the flow transaction
triggeredByEventIdEventIdAny 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
flowTypeResourceFlowTypeSourcewhen user obtains some resource, orSinkwhen user spends some resourcecurrencystringResource name
flowAmountfloatQuantity affected by the flow
finalAmountfloatFinal amount after the flow transaction
itemTypestringType of the Item
itemIdstringAn identifier for the item
flowReasonResourceFlowReasonReason triggering the flow transaction
triggeredByEventIdEventIdAny previous EventId triggering this ResourceFlowEvent. ie: LevelCompleted event triggers ResourceFlowEvent
extraParametersDictionary<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
placementNamestringPlease 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
placementNamestringPlease follow the nomenclature in the relevant document
extraParametersDictionary<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
placementNamestringadPlacementTypeAdPlacementType
RewardedAdTriggered(string, string, AdPlacementType)
[Obsolete("Method called automatically")]
public static void RewardedAdTriggered(string placementId, string placementName, AdPlacementType adPlacementType)
Parameters
placementIdstringplacementNamestringadPlacementTypeAdPlacementType
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
namestringThe name of the property to set. Should contain 1 to 24 alphanumeric characters or underscores and must start with an alphabetic character.
valueobjectThe 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
extraParametersDictionary<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
stepintThe tutorial step
Returns
- EventId
EventId to be referenced, if necessary, in later events as triggers