Google Play Store configuration

This section describes how to connect the Google Play Store with the Purchasely Console

In order to connect your Google Play Store account with Purchasely, you have to provide the following parameters from the Play Store Console

  1. Android App Bundle ID
  2. App Scheme
  3. Access Key (JSON)

1. Android App Bundle ID

  1. Open Google Play Console, go to All Apps
  2. Copy the value displayed below your application name

2. App Scheme

The App Scheme is required to make the paywall preview work.
You need to handle deeplinks as well for your application to give it the SDK to open the paywall preview.
We support scheme such as myapp:// but also universal link like https://myapp.io

You can configure it for your Android app by referring to the following document

  1. Paste your App scheme in the Purchasely Console in the field App Scheme

3. Access Key (JSON)

The access key is provided by Google and is linked to a service account. This access key is mandatory for Purchasely to make requests to Google API and validate purchase receipts.
To retrieve follow the steps below:

  1. Enable API on Google Cloud
  2. Create a new Service Account
  3. Grant access to Service Account

Enabling the API on Google Cloud

You will need to enable 2 APIs on Google Cloud Console

  1. Create or select your existing project
  2. Enable Android Developer API
  1. Enable Developer Reporting API

Creating a new Service Account

Create a dedicated Service Account under the Google Cloud Platform Console
Google Cloud Platform > IAM & admin > Service Account > Create a new Service Account

🚧

Check the selected project

Before creating the service account, make sure that the relevant Project is selected. The drop-down menu in the upper left corner of the screen shall match the Organisation you have set in the previous step

  1. Name your account Purchasely to be able to easily identify it later

  2. Give it the ID purchasely

  3. On the following screen, set the role to "Owner"

    • You can also set "Pub/Sub Admin" and "Monitoring Viewer" as roles instead of "Owner"
  4. On the following screen, note the email generated by Google for your Service Account

  5. Create a key by clicking on the + Create a key button

  6. Choose JSON format to download the file

  1. In the Purchasely Console, fill in the field Access key (JSON) with this JSON file

Granting access to the new Service Account

Grant access to the Service Account under the Google Play Console
Google Play Console> Users & Permissions > Invite new users

Then complete the 3 following steps

  1. Set the email of your service account
  2. Set "no expiration date" by leaving the "Set access expiry date" unchecked
  3. Add your application
  4. Select it
  5. Apply
Under the tab **App permissions**  select the application corresponding to the desired App Bundle ID

Under the tab App permissions select the application corresponding to the desired App Bundle ID

Once you've clicked on Apply, make sure the following permissions are selected:

  • View app information and download bulk reports
  • View financial data, orders, and cancellation survey responses
  • Manage orders and subscriptions
Select the appropriate permissions then click on Apply

Select the appropriate permissions then click on Apply

Finally, click on Invite user to grant access to your service account

Server to Server notifications

We connect to Google Cloud Pub/Sub automatically for you by using your service account access.
Finalize the S2S connection by clicking on Connect to Google in the Purchasely Console and let it guide you.
If you already have it configured with your own server or another provider, after clicking on the button select the topic that you have configured. Purchasely will add a subscription to the same topic to also receives notifications without other steps required on your side.

🚧

Manual configuration

If the button is red, it means that we do no have the right to configure Pub/Sub notifications from Google cloud with the Access Key you have provided. In that case, you need to configure Server to Server notifications manually