Docs > Event types > Event Types, Metrics & Dimensions > Business Events > Business Events and Purchase Validation

Business Events and Purchase Validation

#

business events

Copy link to clipboard

Business events are used to track real money transactions in your game.

With the business event, you can include information on the specific type of in-app item purchased, and where in the game the purchase was made.

#

Examples

Copy link to clipboard

Example A: A player goes into the game’s shop and makes a purchase of a pack of coins.

Example B: You show the player a screen at the end of a level to prompt them to buy lives. They choose to purchase a pack of 3 lives that costs $0.99.

Field Example A Example B
cartType shop endOfLevel
itemType coinPack lives
itemId coinPack2 lifePack3
amount 99 99
currency USD USD

We allow up to 10 cartTypes and up to 100 unique itemTypes and itemIds each.

#

purchase validation

Copy link to clipboard
#

Introduction

Copy link to clipboard

GameAnalytics comes with a fast and easy Purchase Validation solution which allows users to distinguish valid business events from the non-valid ones.

Mobile games can be hacked and distributed illegally.

Hacking an app will often involve faking/simulating all purchase requests.
This will result in several Business events being sent to GameAnalytics for transactions that never occurred. GameAnalytics provides the option of receipt validation for each purchase sent to our servers.

This process can ensure that revenue metrics reflect the actual spending in your game.

The GameAnalytics SDK can automatically capture the purchase receipt from the app store. This is used to validate the purchases and ensure that your monetization data is correct.

We recommend all developers to use the purchase validation system. After you instrument the game you will be able to filter the revenue data accordingly.

Purchase validation is supported only on iOS and Android at the moment.

You need to connect your game to an app store before you can start validating purchases. This can be done within GameAnalytics when adding a game or from the Game Information tab in game settings.

Once the implementation is up and running, all monetization metrics will be split by valid metrics, non-valid metrics and the general metrics.

The valid ones are the result of processing only the business events marked as valid while the non-valid are the those created by processing invalid business events.

#

Bundle ID?

Copy link to clipboard

The bundle ID is the unique identifier that distinguishes your app from others on the stores and it is named by the developer and included in the app for the publishing aspect.

The standard format of the bundle identifier is: com.name_of_company.name_of_app

You are required to declare this identifier in the settings section of your game for serving in-app purchase validation methods.

#

iOS Setup

Copy link to clipboard

We bring a single line solution on the client for sending the business event and validating the transaction which can be easily used anywhere inside your game.

Purchase validation on iOS is a two-step process:

  1. Assign your App Store Bundle ID to your game, by accessing Settings and then the Game information tab.
  2. Fetch the receipt from your in-app purchase provider and attach it to the business event using our built-in method. If the receipt is null/nil then our servers will register that amount as not validated.

For more information on how to include the receipt with the business event, please follow our guides about business events for Unity or for the native iOS SDK.

The validation system on iOS supports sandbox receipts.

#

Android Setup

Copy link to clipboard

Purchase validation on Android is a two-step process:

  1. Assigning the Google Play Store Bundle ID and Google Play Licensing key to your game, by accessing Settings and then the Game information tab.
  2. Fetch the receipt from your in-app purchase provider and attach it to the business event using our built-in method. If the receipt is null/nil then our servers will register that amount as not validated.

For more information on how to include the receipt with the business event, please follow our guides about business events for Unity or for the native Android SDK.

How do I find my app’s Google Play Licensing key (also known as Google Play public key) from the Developer Console?

To find the license key for your application you need to log into your Google Play Developer Console, click All applications and go to Services &APIs under Development tools:

Once you have copied the key you need to add it to your game under the game settings.

#

Common Questions

Copy link to clipboard

Where do I find the Amazon Shared Key?

For the Amazon shared key you will need to login to the site for developers on Amazon and you will be able to find the key in the Shared Key section.

What does GameAnalytics use the Google Play Licensing key (Google Play public key) or the Amazon shared key for?

GameAnalytics uses these keys for verifying in-app purchases related to business events sent to their servers, so invalid purchases made from pirated games don’t pollute the pool of valid business event when doing analysis on the events.

Contact support

Any queries about the platform are welcome.

Give article feedback

Let us know what you think about the articles.