Class AnalyticsKit
AnalyticsKit allows you to get some insight to how the game is running.
Inheritance
Namespace: Pley
Assembly: Pley.dll
Syntax
public static class AnalyticsKit : object
Properties
IsInitialized
Declaration
public static bool IsInitialized { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
ClearAllUserProperties()
Remove all user properties
Declaration
public static PleyResult ClearAllUserProperties()
Returns
Type | Description |
---|---|
PleyResult | Returns result whether succeeds or not. |
CurrencyGained(String, Int32, PleyCurrencyType, Int32, String)
Should be called when the users gains currency
Declaration
public static PleyResult CurrencyGained(string name, int amount, PleyCurrencyType type, int newBalance = null, string source = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the currency |
System.Int32 | amount | The amount gained |
PleyCurrencyType | type | The PleyCurrencyType of the gained currency |
System.Int32 | newBalance | The new balance of the currency. If the value is less than zero it will not be a part of the event. |
System.String | source | The source of where the currency was gained |
Returns
Type | Description |
---|---|
PleyResult | Returns result whether succeeds or not.
In case |
CurrencySpent(String, Int32, PleyCurrencyType, Int32, String)
Should be called when the users spends currency
Declaration
public static PleyResult CurrencySpent(string name, int amount, PleyCurrencyType type, int newBalance = null, string source = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the currency |
System.Int32 | amount | The amount spent |
PleyCurrencyType | type | The PleyCurrencyType of the currency spent |
System.Int32 | newBalance | The new balance of the currency. If the value is less than zero it will not be a part of the event. |
System.String | source | The source of where the currency was spent |
Returns
Type | Description |
---|---|
PleyResult | Returns result whether succeeds or not.
In case |
CustomEvent(String, AnalyticsKit.Parameter[])
Log a custom event
Declaration
public static PleyResult CustomEvent(string name, params AnalyticsKit.Parameter[] parameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the event |
AnalyticsKit.Parameter[] | parameters | The parameters |
Returns
Type | Description |
---|---|
PleyResult | Returns result whether succeeds or not.
In case |
GameLoaded()
Should be called when the initial loading screen is complete and the game is playable by the user.
Declaration
public static PleyResult GameLoaded()
Returns
Type | Description |
---|---|
PleyResult | Returns result whether succeeds or not. In case the method has already been used it will return AtkEventAlreadyReported |
GameplayStart()
Should be called gameplay starts
Declaration
public static PleyResult GameplayStart()
Returns
Type | Description |
---|---|
PleyResult | Returns result whether succeeds or not. |
GameplayStop()
Should be called gameplay stops
Declaration
public static PleyResult GameplayStop()
Returns
Type | Description |
---|---|
PleyResult | Returns result whether succeeds or not. |
Initialize(AnalyticsKit.Config)
Initialize the analytics with specific properties
Declaration
public static PleyResult Initialize(AnalyticsKit.Config config = default(AnalyticsKit.Config))
Parameters
Type | Name | Description |
---|---|---|
AnalyticsKit.Config | config | The analytics config |
Returns
Type | Description |
---|---|
PleyResult | Returns result whether succeeds or not. |
Remarks
This method should be called before any events are logged.
LevelAdvanced(Int32)
Should be called if the user advances in level
Declaration
public static PleyResult LevelAdvanced(int level)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | level | The new user level |
Returns
Type | Description |
---|---|
PleyResult | Returns result whether succeeds or not. |
LoadingStart()
Should be called when loading starts (i.e. start loading a new scene)
Declaration
public static PleyResult LoadingStart()
Returns
Type | Description |
---|---|
PleyResult | Returns result whether succeeds or not. |
LoadingStop()
Should be called when loading stops (i.e. after a scene has been loaded)
Declaration
public static PleyResult LoadingStop()
Returns
Type | Description |
---|---|
PleyResult | Returns result whether succeeds or not. |
OfferShown(String)
Should be called when an offers is shown to the user
Declaration
public static PleyResult OfferShown(string offer)
Parameters
Type | Name | Description |
---|---|---|
System.String | offer | The name of the offer. |
Returns
Type | Description |
---|---|
PleyResult | In case |
RemoveUserProperty(String)
Remove a user property
Declaration
public static PleyResult RemoveUserProperty(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the property |
Returns
Type | Description |
---|---|
PleyResult | Returns result whether succeeds or not.
In case |
SetUserProperty(String, AnalyticsKit.Variant)
Set a user property
Declaration
public static PleyResult SetUserProperty(string name, AnalyticsKit.Variant variant)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the property |
AnalyticsKit.Variant | variant | The property value |
Returns
Type | Description |
---|---|
PleyResult | Returns result whether succeeds or not.
In case |
SetUserProperty(String, Boolean)
Set custom user property
Declaration
public static PleyResult SetUserProperty(string name, bool value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the property |
System.Boolean | value | Property bool value |
Returns
Type | Description |
---|---|
PleyResult | Returns result whether succeeds or not.
In case |
SetUserProperty(String, Byte)
Set custom user property
Declaration
public static PleyResult SetUserProperty(string name, byte value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the property |
System.Byte | value | Property byte value |
Returns
Type | Description |
---|---|
PleyResult | Returns result whether succeeds or not. |
SetUserProperty(String, Int32)
Set custom user property
Declaration
public static PleyResult SetUserProperty(string name, int value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the property |
System.Int32 | value | Property int value |
Returns
Type | Description |
---|---|
PleyResult | Returns result whether succeeds or not.
In case |
SetUserProperty(String, Int64)
Set custom user property
Declaration
public static PleyResult SetUserProperty(string name, long value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the property |
System.Int64 | value | Property long value |
Returns
Type | Description |
---|---|
PleyResult | Returns result whether succeeds or not.
In case |
SetUserProperty(String, Single)
Set custom user property
Declaration
public static PleyResult SetUserProperty(string name, float value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the property |
System.Single | value | Property float value |
Returns
Type | Description |
---|---|
PleyResult | Returns result whether succeeds or not.
In case |
SetUserProperty(String, String)
Set custom user property
Declaration
public static PleyResult SetUserProperty(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the property |
System.String | value | Property string value |
Returns
Type | Description |
---|---|
PleyResult | Returns result whether succeeds or not.
In case |
StoreOpened()
Should be called when the store is opened.
Declaration
public static PleyResult StoreOpened()
Returns
Type | Description |
---|---|
PleyResult | Returns result whether succeeds or not. |
TutorialAdvanced(String)
Should be called when the user is advanced in the tutorial
Declaration
public static PleyResult TutorialAdvanced(string step)
Parameters
Type | Name | Description |
---|---|---|
System.String | step | The name of the tutorial step |
Returns
Type | Description |
---|---|
PleyResult | Returns result whether succeeds or not.
In case |
TutorialCompleted()
Should be called when the user completes the tutorial
Declaration
public static PleyResult TutorialCompleted()
Returns
Type | Description |
---|---|
PleyResult | Returns result whether succeeds or not. |
TutorialSkipped()
Should be called if the user skips the tutorial
Declaration
public static PleyResult TutorialSkipped()
Returns
Type | Description |
---|---|
PleyResult | Returns result whether succeeds or not. |
TutorialStarted()
Should be called when the user is starting the tutorial
Declaration
public static PleyResult TutorialStarted()
Returns
Type | Description |
---|---|
PleyResult | Returns result whether succeeds or not. |
UserEngaged()
Should be called when the user is considered engaged. The timing of this event will vary from game to game, but should be triggered once the initial tutorial is completed or the first level is passed
Declaration
public static PleyResult UserEngaged()
Returns
Type | Description |
---|---|
PleyResult | Returns result whether succeeds or not. In case the method has already been used it will return AtkEventAlreadyReported |
UserInteracted()
Should be called when the user makes their first game interaction, such as pressing a button or interacting with a game mechanic.
Declaration
public static PleyResult UserInteracted()
Returns
Type | Description |
---|---|
PleyResult | Returns result whether succeeds or not. In case the method has already been used it will return AtkEventAlreadyReported |