Using the SDK - GameAnalytics/GA-SDK-JAVASCRIPT GitHub Wiki

Now we should be ready for adding code to activate the SDK!
There are 3 phases the SDK will go through.

  1. configuration
  2. initialization
  3. adding events or changing dimensions

 

Configuration calls configure settings for the SDK and some will not be able to be altered after initialize has been called.

Initialize call will start the SDK and activate the first session.

The configuration and initialization steps should be called when the application starts.

Once step 1 & 2 is done you can add events at different parts of the game code where some relevant action is happening.

Remember to add this line to the html file whenever you need to call the SDK.

<script src="/path/to/GameAnalytics.js" /> 
<!-- or <script src="/path/to/GameAnalytics.min.js" /> -->

 

NEXT  →