-
Notifications
You must be signed in to change notification settings - Fork 9
Initializing
Martin Treacy-Schwartz edited this page Mar 16, 2017
·
3 revisions
Call this method to initialize using the game key and secret key for your game.
// Initialize
GameAnalytics.Initialize("[game key]", "[secret key]");
💡
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]");
}
}
}