Initializing - GameAnalytics/GA-SDK-C-SHARP GitHub Wiki
Call this method to initialize using the game key and secret key for your game.
// Initialize
GameAnalytics.Initialize("[game key]", "[secret key]");
:bulb:
Don't have any keys yet? Head over here and register your game at the GameAnalytics website!
Below is a common example of the code placed in a method lets call it OnStart (which is called at the beginning of the game).
using GameAnalyticsSDK.Net;
namespace MyGame
{
public class MyGameClass
{
// ... other code from your project ...
void OnStart()
{
GameAnalytics.SetEnabledInfoLog(true);
GameAnalytics.SetEnabledVerboseLog(true);
GameAnalytics.ConfigureBuild("0.10");
GameAnalytics.ConfigureAvailableResourceCurrencies("gems", "gold");
GameAnalytics.ConfigureAvailableResourceItemTypes("boost", "lives");
GameAnalytics.ConfigureAvailableCustomDimensions01("ninja", "samurai");
GameAnalytics.ConfigureAvailableCustomDimensions02("whale", "dolpin");
GameAnalytics.ConfigureAvailableCustomDimensions03("horde", "alliance");
GameAnalytics.Initialize("[game key]", "[secret key]");
}
}
}