Event Tracking

The Spil Games platform provides you with dedicated insight into how your users are experiencing your games. This is enabled through powerful event tracking.

Google Analytics (part of Google Firebase) is used to monitor default events. These are events that are expected in every game. A set of default events are provided in the Spil Games SDK and are discussed later in this chapter. While this provides insight into generic user behavior (such as the number of concurrent and unique users), it does not perform in-depth analysis. Moreover, it does not offer the possibility to create game-specific reports.

For this reason, event tracking is extended through the Spil Games custom-built analytics solution. The Spil Games Event Tracker (SET) provides for deeper insight into the unique aspects of your game through highly customizable reports. Examples are shown in Figure 2.


Figure 2: Customized Usage Reports.

This is further augmented by the industry-standard Adjust attribution tool. Using this functionality, you can see from exactly where your users are coming. For example, when a user clicks on a Facebook campaign and installs your app. The operation of event tracking within the Spil Games platform is shown in Figure 3.


Figure 3: Event Tracking Within the Spil Games Platform.

To facilitate this insight, Spil Games needs to know the events that require tracking. This will differ depending on the nature and design of your game. All required event-tracking information should be discussed and agreed between the game’s designers and the Spil Games Account Manager. When finalized, they are delivered to the game’s developers in a Microsoft Excel spreadsheet.

Important

No changes or additions should be made to the specified event-tracking calls without prior discussion and approval from your Spil Games Account Manager.

Enabling Google Analytics and Adjust

A Google Analytics ID and Adjust application token should be added to the defaultGameConfig.json file to enable both SDKs. The following lines should be present in your file:

Make sure to use the Configuration menu in Unity in the top bar to automatically create the necessary files (Spil SDK->Configuration->General->Create Default Configuration Files).

Default Event Handling

Default events are events that are expected in every game and can be applied to most games. The Spil Games SDK contains helper object for each of these.
The standard structure of an event is the following:

SpilTracking.{EventName}({RequiredParametersValues}).Add{OptionalParameters}({OptionalParametersValues}).Track();

Some example are described below:

Simply call the corresponding method at the required point in your game, and the SDK will send the event to the Spil Games backend. It is important that the expected parameters for your game are carefully checked. These must be correct for successful completion of the QA process. Descriptions of all methods and parameters are included in the provided SDK code.

Important

When testing events, do not reset your iOS IDFA or Google advertising ID. This may cause the game to appear to have new users.

Tracking In-app Purchases on Android

The tracking of in-app purchases is straightforward. Once you send an iapPurchasedEvent event, we alter the data with the price and currency values. To do this, we ask you to define the googleIAPKey setting in the Spil Games defaultGameConfig.json file. For more information, see “Implementing a Default Configuration File”.