GameAnalytics
As long awaited, we are finally able to include analytics into our system. We’ve implemented them much like the ad functionality, so that you will be able to submit events to multiple analytics providers at once (when we get around to implementing them).
GameAnalytics is a popular analytics platform that is free for users. They make money when you upgrade to more advanced services, which you’ll likely be able to afford if you get to that point!
For now, we’ve designed the system around how GameAnalytics does things:
- Ad / Impression events.
- We track the following Ad events automatically:
- FailedShow
- Clicked
- Show
- RewardReceived
- We track the following Ad events automatically:
- Progression - These events are used to track user progress through a game as you define it.
- By default GameSalad tracks scene changes after the scene has successfully changed. This can be turned off at publishing time.
- You can manually send Progress events with a special TweetSheet call. Read more below.
- In GameAnalytics code this is equivalent to calling:
GameAnalytics.addProgressionEvent(GAProgressionStatus.Complete, "Game", "Scene", previousSceneName); GameAnalytics.addProgressionEvent(GAProgressionStatus.Start, "Game", "Scene", nextSceneName);
- Business Events - Events related to IAP’s. More below.
- Resources - Events for tracking in game economy. These could result from IAP, ad rewards, or in game “store” purchases. These are a good way to see if you’re granting too much or too little of a given in-game resource and allow you to tweak how much you give in your game. More below.
- Design events - You can track “Design” events via TweetSheet. More below.
IAPs
An IAP results in two event types. It will always result in a “Business” event and will sometimes result in a “Resource” event.
The first thing you need to set up is the purchase metadata, which for now will be stored in the purchase table’s title field (the first grayed out column). This will contain a colon (:) separated list of strings that define the following:
All IAPs
itemType - A category for the item. Things like: “Gold Packs”, “Weapons”, etc.
Consumable IAPs
consumableType - A category for consumable items. Things like “Gold”, “Jewels”, etc.
consumableQty - A number for the number of the consumable purchased
For instance, if your IAP row is a consumable purchase for 100 coins, you’d set the title column as something like:
Coin Packs:Coins:100
A non-consumable IAP for removing ads you’d just put something like:
Remove Ads
Eventually these will be new columns in the purchase table, but for now just add them as part of the column's title.
When a IAP is completed, the following business event is sent using the itemType
GameAnalytics.addBusinessEvent( currecyCode, amount, itemType, purchaseItemId, eventSource, receipt, "google_play", signature);
If the consumableType and consumableQty are defined, then we’ll also track a Resource event as follows:
GameAnalytics.addResourceEvent( GAResourceFlowType.Source, consumableType, consumableQty, itemType, purchaseItemId);
Comments
Custom / Manual Events with Tweet Sheet
For the time being, we’ll be using the Tweet Sheet action to allow for custom events. The TweetSheet behavior has both a Message and Image field. The message field will always have: gs:trackEvent to tell the engine that you want to send an analytics event.
The image field will be the particular analytics command followed by :|: followed by a : delimited list of strings as parameters. If the string doesn’t include :|: it’s assumed to be a custom event and will be sent as such.
Resource Event
While we automatically call the Source Resource event on IAP, you can also manually track the Minting and Consumption of consumables manually. In fact, you have to manually track consumption, since those items are usually consumed during gameplay well after the IAP event.
The IAP Consume Behavior is not an in-game concept, but only to indicate to the store that the game has acknowledged receipt of the item, so we couldn’t do it there.
ConsumableMint - Creates a Source Resource event, indicating you are creating / giving a consumable item to a player.
ConsumableSink - Creates a Sink Resource event, indicating an consumable item has been consumed by the player or the game.
Both of these events have the same parameters:
consumableType - The type of the item minted (“Gold”, “Jewels”, “Potions”, etc)
consumedQty - The number of items minted.
eventSource (optional; default Manual) - An indicator of the event that granted the user the item (“IAP”, “Gift”, “Random Drop”, “Boss Drop”)
purchaseItemId (optional; default Minted) - Optional purchaseItemId. This is usually used by the IAP system to place your actual purchaseId, but you can use any value you’d like here that might help you in tracking your economy like “level1Drops” or “progressGift”
Example:
Progress Events
There are 3 progress event types: Start, Complete, Fail.
After that, you can provide up to 3 more arguments to detail where in the game progress is being tracked. For instance you could track something like a user failing World 1, Level 2.
Example:
Design Events
Design events are a way to track arbitrary metrics in your game. You can include a hierarchy of up to 5 segments in your event and also include a float value should you want to track something numerical. You use gs:trackEvent as the message.
Say you want to measure the time your players need to kill a boss in your game.
Example: