Android – How to retrieve stats data?

Set up a Google Cloud service account

https://console.cloud.google.com

  • Create a new project if you don’t have one
  • Create a service account
  • Create a new key for this service account
  • Assign this role to download stats csv (App Download number, Install Events number, etc…)
  • Enable necessary APIs

Add service account to Play console

https://play.google.com/console

  • Add service account email address to Play Console
  • Select this permission if you want to download stats csv (App Download number Install events, …)

Create a script to fetch Play console data

Troubleshooting

  • If you want to specify a specific app in Play Console, select a specific app as follows. This is to retrieve app details, release details.
    However, you still need the above “View app information and download bulk reports (read only)” to download csv
    const auth = new google.auth.GoogleAuth({
      credentials: keys,
      scopes: [
        'https://www.googleapis.com/auth/androidpublisher',
        'https://www.googleapis.com/auth/playdeveloperreporting',
        'https://www.googleapis.com/auth/devstorage.read_only'
      ],
    });
  • or permission in service account – should not need though!
  • or enable these APIs – should not need these though

Be the first to comment

Leave a Reply

Your email address will not be published.


*