Skip to main content

Forward in-app purchases on Android

When users make an in-app purchase, we receive data in three ways:

  1. The justtrack SDK, when properly configured, forwards the transaction to our backend.
  2. The Google Play Store sends a notification to our backend.
  3. Our backend requests the transaction's price information from Google Play.

In this guide, you'll learn how to configure your accounts in justtrack and Google Play so we can receive the necessary data from each of these sources.

SDK setup

Read our Android, React Native, or Unity SDK documentation for setup instructions.

Create a service account

In Google Cloud, navigate to IAM & Admin > Service Accounts:

Create a new service account for your project

Click CREATE SERVICE ACCOUNT:

Create a new service account for your project

Provide the following service account details:

  • Name: "justtrack IAP Verification"
  • Description: "Allows the justtrack backend to request IAP price information"

Then, click Create and continue.

In the next step, select the Monitoring Viewer role:

Configure the service account

Click Done. This will return you to the service accounts list. From here, copy the justtrack-iap-verification email for the service account you just created. You'll need this later.

Next, go to the Keys tab and select ADD KEY > Create new key:

Create a new key for your service account

Create the key in JSON format:

Creating a new key for your service account

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.

Now, you need to grant access to the email you copied earlier. Go to the Google Play Console, and select your developer account.

In the left navigation, go to Users and permissions and click Invite new users:

Creating a new key for your service account

Paste the justtrack-iap-verification email address you copied earlier, and click Invite.

Then, switch to Account permissions, and 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
Creating a new key for your service account

Click Save changes.

Configure real-time developer notifications

Now, you need to set the Topic name for Google Play Billing in order to send real-time developer notifications to justtrack so you can see them in your account.

Under Monetize with Play > Monetization setup:

  1. Enable real-time notifications
  2. Set the topic name to projects/justtrackio/topics/real-time-developer-notifications
  3. Select Subscriptions, voided purchases, and all one-time products
Creating a new key for your service account

Configure your service account in justtrack

Now that you've configured your service account and enabled real-time developer notifications, you need to upload the JSON file you received when you created the key.

In justtrack, navigate to Admin > Apps:

Navigate to 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:

Manage monetization integrations

On the Monetization page, click Purchase Verification Credentials:

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.

info

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, React Native, and Unity justtrack SDKs, and you'll see the revenue you make from them on the justtrack dashboard.