Docs > Event types > Best Practices > Purchase Validation

Purchase Validation

Important: We recommend all developers to use the purchase validation system.

Your game must be connected 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.

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

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.

After you instrument the game you will be able to filter the revenue data accordingly.

FYI: Hacking and Illegal Distribution In Mobile Games

There are many factors that can degrade the revenue information tracked such as client issues or hacking. 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.

The tool assimilates all received business events from the client and it is highly recommended to implement the validation feature in order to view which of your revenue events are legit.

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

#

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.

Note: 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.

#

Common Questions

Copy link to clipboard

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.

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.

For instrumenting the client please follow our guides for Unity or for the native Android SDK.

Contact support

We’ll get back to you ASAP.

Report a bug

Let us know more details.