+31 (0) 20 760 2040 info@spilgames.com

Spil SDK – Event tracking

Spil Event tracker, Google Analytics & Adjust

Besides the our custom Spil event tracker the Spil SDK contains also Google analytics and Adjust. Google analytics helps to get insight in various user behavior metrics and Adjust helps us to attribute installs. Google Analytics is also capable of tracking crashes within your application. It’s already integrated within the Spil SDK; it tracks install, real-time users and crashes.

Before you start

Before you start implementing the Event tracking calls it is important that you first receive the Event list of all events to be integrated in the game first. This event list will be determined by our BI department and delivered to you in excel. It’s really important that you won’t make changes yourself or add your own additional custom events.

An google analytics id and Adjust app token should be added to the defaultGameConfig.json to enable both SDKs:

Note: The google analytics id and Adjust app token is provided by Spil Games.

Default events

Tracking a game correctly and accurate is very important for doing in depth analyses on your game.
Besides events we track automatically within the SDK We ask you to at least implement a default list of events.
The SDK provides a number of default methods that can be called in order to send specific events.
These methods can be accessed in the following way:

Note: when testing events, please don’t reset your idfa.

Additionally we might ask you to implement also another set of custom events, please confirm this list with your Spil Games account manager.

Below methods should be self explanatory for tracking Spil Games Events:

Please pay close attention to the expected params, these will need to be correct for the game to pass QA.
A good way to validate the events after implementation is to use a network sniffer. On this page you can find a tutorial on how to use a network sniffer called Charles.

General events that need to be implemented

IAP

Event types Required Parameters Note
iapPurchased skuId, transactionId, purchaseDate
iapRestored skuId, originalTransactionId,originalPurchaseDate
iapFailed error, skuId

The parameters are explained below:

  • skuId (string) – The product identifier of the item that was purchased
  • transactionId (string) – The transaction identifier of the item that was purchased (also called orderId)
  • purchaseDate (string) – The date and time that the item was purchased
  • originalTransactionId (string) – For a transaction that restores a previous transaction, the transaction identifier of the original transaction. Otherwise, identical to the transaction identifier
  • originalPurchaseDate (string) – For a transaction that restores a previous transaction, the date of the original transaction
  • error (string) – Error description or error code

USER BEHAVIOUR

tutorialComplete

tutorialSkipped

registerplatform
Event will be triggered after the user completes registration via email, Facebook, Google Plus or other available option. Registration option is assumed. The ‘platform’ is a string like ‘facebook’ or ’email’.shareplatform
Event will be triggered every time the user shares content on their social media accounts. Social media integration is assumed.. The ‘platform’ is a string like ‘facebook’.inviteplatform
Event will be triggered every time the user invites another user. Respective function in-game is assumed. The ‘platform’ is a string like ‘facebook’.

Event types Required Parameters Optional Note
walletUpdate walletValue, itemValue, source, item, category
milestoneAchieved name
levelStart level
levelComplete level score, stars, turns
levelFailed level score, turns

The parameters are explained below:

  • walletValue (int) – The new wallet value after subtracting the item value. E.g coins
  • itemValue (int) – The value of the item consumed. E.g. coins. (note: This property can also be negative, for example if a user spends coins, the itemValue can be -100)
  • source (int) – 0 == premium
  • item (string) – item id or sku
  • category (int) – 0 = Consumable, 1 = Booster, 2 = Permanent
  • name (string) – name of the milestone
  • level (string) – name of the level
  • score (int) – The final score the player achieves at the end of the level
  • stars (int) – The # of stars (or any other rating system) the player achieves at the end of the level
  • turns (int) – The # of moves/turns taken to complete the level
  • platform (string) E.g. ‘facebook’