Verify Android in-app purchases
To ensure we don't count cancelled or duplicated in-app purchases forwarded from your app, we validate each purchase in the justtrack backend. To make this possible for Android apps, you must provide a credentials file for your Play Store service account. The service account provides an application (instead of a user) access to the Google Play Developer Publishing API. Using this access, we can accurately track purchases made by your users and display the correct revenue for your app.
Create a service account
In the Google Play Developer Console, navigate to the Setup > API access settings page. Then, click Choose a project to link:
Agree to the terms of service:
Select Link existing Google Cloud project and Google Play Console Developer from the drop-down. Then, click Save:
If you haven't created a Google Cloud project for your app already, you have to select Create a new Google Cloud project instead. After creating a new project, it should already be linked. If this isn't the case, you have to link it manually.
At the bottom of the page, click Create new service account and click the link to Google Cloud Platform from the dialog.
On the Google Cloud page, click Create Service Account:
Then, name your service account:
In the next step, select the Monitoring Viewer role:
After creating the service account, select the account, go to the Keys tab and select ADD KEY > Create new key:
Create the key in JSON format:
Once you create the key, it will be automatically downloaded to your computer. You'll upload this to the justtrack platform in a future step.
Grant the service account access to your apps
After creating the service account, you need to grant it access permissions on the Google Play Console.
Navigate to API access. Here, you'll find your new service account. Next to it, click Manage Play Console permissions:
Now, give the service account the following permissions:
- View app information and download bulk reports (read only)
- View financial data, orders and cancellation survey responses
- Manage orders and subscriptions
Then, click Invite user:
Configure your service account in justtrack
To get your in-app purchases verified and tracked by justtrack, you need to upload the JSON file you received when you created the key.
In justtrack, navigate to Admin > Apps:
Here, you'll find the list of apps connected to your justtrack account. Next to the app for which you want to verify purchases, click See Details.
Now, you're in the App Hub. From here, you can configure how you monetize your app.
On the Monetization card, click Manage Integration:
On the Monetization page, click Purchase Verification Credentials:
Here, you'll upload the JSON file you downloaded in a previous section. In the App Hub, you'll see an indication that you've successfully set up in-app purchase tracking.
It can take up to 48 hours for the permissions you configured for your new service account to propagate through Google's internal systems. Therefore, it might take a while to see in-app purchase revenue for your app.
You can now start forwarding in-app purchases from the Android and Unity justtrack SDKs and you'll see the revenue you make from them on the justtrack dashboard.