# Connect Google Play Console to Storevisor

> Every Android app's tracks, releases, rollouts, store listing and Data safety form.

## What it unlocks in Storevisor

- Every Android app on the release board: each track's release and rollout.
- Promoting a release between tracks, and changing or halting a staged rollout.
- Store listings, app details and the Data safety form.

## The access it needs

| For | Least role or permission |
|---|---|
| Statistics and reviews files (the reports bucket) | View app information and download bulk reports, at account level |
| Earnings | View financial data, orders, and cancellation survey responses |
| Replying to reviews | Reply to reviews |
| Listings, app details and Data safety (Storevisor) | Manage store presence |
| Promotions and rollouts (Storevisor) | Release apps to testing tracks; Release to production, exclude devices, and use Play App Signing |

- The permission names are Play Console's own (Users and permissions, the service account, Account permissions). Give only the rows for what you use.
- The check before saving reads the reports bucket. A missing permission for reviews, earnings or releases shows later, as Google's own refusal in that step of the sync or in that tool's answer.

## Steps

1. In Google Cloud, create a service account and add a JSON key. [Open service accounts](https://console.cloud.google.com/iam-admin/serviceaccounts)
2. Enable the Google Play Android Developer API on that project. [Enable the API](https://console.cloud.google.com/apis/library/androidpublisher.googleapis.com)
3. In Play Console, Users and permissions, invite the service account's email with: view app information and download bulk reports, view financial data, reply to reviews. [Open Users and permissions](https://play.google.com/console/developers/users-and-permissions)
4. Download reports, Statistics, then copy the Cloud Storage URI: the part after gs:// up to the first slash is your reports bucket (pubsite_prod_…).
5. In Storevisor, open Connections, choose Google Play Console, fill in the form and save. The connection is checked live with the store first; a connection that fails the check is never saved.

## What the form asks for

- Service account JSON key (optional)
- Or paste the JSON (optional)
- Reports bucket (required)

## After connecting

- Google Play publishes its statistics as monthly files, several days behind. The first sync reads every file in the bucket, so older months arrive at once.

## Errors the check can show

The exact sentence the Connections page shows (<angle brackets> are your own values), then what to do.

- "The service account JSON is required."
  Upload the JSON key file you downloaded from Google Cloud, or paste its contents.
- "the uploaded JSON: not valid JSON"
  The file is not the key file, or the paste was cut short. Download the key again (Google Cloud, IAM and Admin, Service accounts, the account, Keys, Add key, JSON).
- "service account JSON is missing client_email/private_key"
  This is not a service account key file (an OAuth client file looks similar). Create a JSON key for the service account.
- "Upload a service account key ("type": "service_account"), not a user credential."
  A personal sign-in file was uploaded. Only a service account key is accepted.
- "Reports bucket is required."
  Play Console, Download reports, Statistics: copy the Cloud Storage URI.
- "The reports bucket looks like pubsite_prod_1234567890."
  Paste the part of the Cloud Storage URI after gs:// up to the first slash.
- "Google refused the service-account key (deleted or clock skew) — download a new key"
  The key was deleted or disabled in Google Cloud. Add a new JSON key to the service account and upload it.
- "403 on bucket <bucket>: grant <service account e-mail> "Storage Object Viewer" (Play Console → Users and permissions → View app information and download bulk reports)"
  Invite the service account in Play Console with View app information and download bulk reports at account level. Google can take a while to apply a new grant; try again later if it was just added.
- "bucket <bucket> not found — check PLAY_REPORTS_BUCKET (Play Console → Download reports → Copy Cloud Storage URI)"
  The bucket name is wrong. Copy the Cloud Storage URI again.
- "GCS answered <status>: <answer>"
  Google Cloud Storage answered something unexpected. Try again in a few minutes.

Errors any connection can show: https://storevisor.devino.ca/docs/connect.md
