Resource Events
Resource events are used to track virtual economy activity - any time players gain or spend currency. They help model currency flow, detect imbalances and evaluate monetization strategies.
These events must be manually implemented. Refer to the SDK Documentation for code examples specific to your platform (Unity, Unreal, Roblox, iOS, Android, etc.).
Resource Events Fields
| Field | Description | Type | Possible Values | Required |
|---|---|---|---|---|
| category | Event category | String | resource | Yes |
| flow_type | The direction of the resource transaction | enum | source (player gains) sink (player spends currency or its deducted) | Yes |
| item_type | Category of the item involved in the transaction | string | Up to 20 unique items types are allowed | No |
| item_id | Specific identifier for the item | string | boots_of_speed | No |
| amount | Number of units added or removed | float | 69 | No |
| resource_currency | Type of virtual currency used | string | Up to 50 unique currencies are allowed | Yes |
You will need to define a list of allowed currencies (up to 50) and item types (up to 20) when you implement your game with the GameAnalytics SDK. Visit the specific [SDK integration pages]((/event-tracking-and-integrations/sdks-and-collection-api/sdks-overview) to learn how to define these.
Resource Event Examples
| Field | Example A: A user spends a life by starting a game. | Example B: A user buys a boost in the game with 100 gold currency | A user earns 55 coins for making a match in a game/level | Example D: A user makes an in-app purchase to buy a pack of 100 gold currency |
|---|---|---|---|---|
| category | resource | resource | resource | resource |
| flow_type | sink | sink | source | source |
| item_type | startGame | boost | gameplay | IAP_purchase |
| item_id | rainbowBoost | reward | goldPack | |
| amount | 1 | 100 | 55 | 100 |
| resource_currency | life | gold | coins | gold |
There could be scenarios where two events should be triggered for the same action. E.g. For Example D, you should also trigger a Business event to track the in-app purchase transaction. This will give you a full view of your real-money revenue.