Load Google Play data into BigQuery

You can load data from Google Play to BigQuery using theBigQuery Data Transfer Service for Google Play connector. With theBigQuery Data Transfer Service, you can schedule recurring transfer jobs thatadd your latest data from Google Play toBigQuery.

Connector overview

The BigQuery Data Transfer Service for the Google Play connector supports the following options for your data transfer.

Data transfer optionsSupport
Supported reports

For information about how Google Play reports are transformed into BigQuery tables and views, seeGoogle Play report transformation.

Repeat frequencyThe Google Play connector supports daily data transfers.

By default, data transfers are scheduled at the time when the data transfer is created. You can configure the time of data transfer when youset up your data transfer.
Refresh windowThe Google Play connector retrieves Google Play data from up to 7 days at the time the data transfer is run.

For more information, seeRefresh windows.
Backfill data availabilityRun a data backfill to retrieve data outside of your scheduled data transfer. You can retrieve data as far back as the data retention policy on your data source allows.

Data ingestion from Google Play transfers

When you transfer data from Google Play into BigQuery, thedata is loaded into BigQuery tables that are partitioned by date.The table partition that the data is loaded into corresponds to the date fromthe data source. If you schedule multiple transfers for the same date,BigQuery Data Transfer Service overwrites the partition for that specific date withthe latest data. Multiple transfers in the same day or running backfills don'tresult in duplicate data, and partitions for other dates are not affected.

Refresh windows

Arefresh window is the number of days that a data transfer retrieves datawhen a data transfer occurs. For example, if the refresh window is three daysand a daily transfer occurs, the BigQuery Data Transfer Service retrieves all data fromyour source table from the past three days. In thisexample, when a daily transfer occurs, the BigQuery Data Transfer Service creates a newBigQuery destination table partition with a copy of your source table datafrom the current day, then automatically triggers backfill runs to update theBigQuery destination table partitions with your source table data from thepast two days. The automatically triggered backfill runs will either overwriteor incrementally update your BigQuery destination table,depending on whether or not incremental updates are supported in theBigQuery Data Transfer Service connector.

When you run a data transfer for the first time, the data transfer retrieves allsource data available within the refresh window. For example, if the refreshwindow is three days and you run the data transfer for the first time, theBigQuery Data Transfer Service retrieves all source data within three days.

To retrieve data outside the refresh window, such as historical data, or torecover data from any transfer outages or gaps, you can initiate or schedule abackfill run.

Limitations

  • The minimum frequency that you can schedule a data transfer for is once every24 hours. By default, a transfer starts at the time that you create thetransfer. However, you can configure the transfer start time when youset up your transfer.
  • The BigQuery Data Transfer Service does not support incremental data transfers during aGoogle Play transfer. When you specify a date for a data transfer, allof the data that is available for that date is transferred.

Before you begin

Before you create a Google Play data transfer:

  • Verify that you have completed all actions required toenable the BigQuery Data Transfer Service.
  • Create a BigQuery datasetto store the Google Play data.
  • Find your Cloud Storage bucket:
    1. In theGoogle Play console,clickDownload reports and selectReviews,Statistics, orFinancial.
    2. To copy the ID for your Cloud Storage bucket, clickCopy Cloud Storage URI.Your bucket ID begins withgs://. For example, for thereviews report, your ID is similar to the following:
      gs://pubsite_prod_rev_01234567890987654321/reviews
    3. For the Google Play data transfer, you need to copy only the unique ID that comes betweengs:// and/reviews:
      pubsite_prod_rev_01234567890987654321
  • If you intend to setup transfer run notifications for Pub/Sub, youmust havepubsub.topics.setIamPolicy permissions. Pub/Subpermissions are not required if you just set up email notifications. For moreinformation, seeBigQuery Data Transfer Service run notifications.

Required permissions

Ensure that you have granted the following permissions.

Required BigQuery roles

To get the permissions that you need to create a BigQuery Data Transfer Service data transfer, ask your administrator to grant you theBigQuery Admin (roles/bigquery.admin) IAM role on your project. For more information about granting roles, seeManage access to projects, folders, and organizations.

This predefined role contains the permissions required to create a BigQuery Data Transfer Service data transfer. To see the exact permissions that are required, expand theRequired permissions section:

Required permissions

The following permissions are required to create a BigQuery Data Transfer Service data transfer:

  • BigQuery Data Transfer Service permissions:
    • bigquery.transfers.update
    • bigquery.transfers.get
  • BigQuery permissions:
    • bigquery.datasets.get
    • bigquery.datasets.getIamPolicy
    • bigquery.datasets.update
    • bigquery.datasets.setIamPolicy
    • bigquery.jobs.create

You might also be able to get these permissions withcustom roles or otherpredefined roles.

For more information, seeGrantbigquery.admin access.

Required Google Play roles

Ensure that you have the following permissions in Google Play:

  • You must have reporting access in theGoogle Play console.

    The Google Cloud team doesNOT have theability to generate or grant access to Google Play files on your behalf. SeeContact Google Play supportfor help accessing Google Play files.

Set up a Google Play transfer

Setting up a Google Play data transfer requires a:

  • Cloud Storage bucket. Steps for locating your Cloud Storage bucket aredescribed inBefore you begin.Your Cloud Storage bucket begins withpubsite_prod_rev. Forexample:pubsite_prod_rev_01234567890987654321.
  • Table suffix: A user-friendly name for all data sources loading into thesame dataset. The suffix is used to prevent separate transfers from writingto the same tables. The table suffix must be unique across all transfers thatload data into the same dataset, and the suffix should be short to minimizethe length of the resulting table name.

To set up a Google Play data transfer:

Console

  1. Go to the Data transfers page in the Google Cloud console.

    Go to Data transfers

  2. ClickCreate transfer.

  3. On theCreate Transfer page:

    • In theSource type section, forSource, chooseGoogle Play.

      Transfer source

    • In theTransfer config name section, forDisplay name, enter aname for the data transfer such asMy Transfer. The transfer name canbe any value that lets you identify the transfer if you need to modifyit later.

      Transfer name

    • In theSchedule options section:

      • ForRepeat frequency, choose an option for how often to run thedata transfer. If you selectDays, provide a valid time in UTC.
      • If applicable, select eitherStart now orStart at set time,and provide a start date and run time.
    • In theDestination settings section, forDestination dataset,choose the dataset that you created to store your data.

      Transfer dataset

    • In theData source details section:

      • ForCloud Storage bucket, enter the ID for yourCloud Storage bucket.
      • ForTable suffix, enter a suffix such asMT (forMy Transfer).

      Google Play source details

    • In theService Account menu, select aservice account from the serviceaccounts that are associated with your Google Cloud project. Youcan associate a service account with your data transfer instead of usingyour user credentials. For more information about using service accountswith data transfers, seeUse service accounts.

    • (Optional) In theNotification options section:

      • Click the toggle to enable email notifications. When you enable thisoption, the transfer administrator receives an email notificationwhen a transfer run fails.
      • ForSelect a Pub/Sub topic, choose yourtopic name or clickCreate a topic. This option configures Pub/Sub runnotifications for yourtransfer.
  4. ClickSave.

bq

Enter thebq mk command and supply the transfer creation flag —--transfer_config. The following flags are also required:

  • --target_dataset
  • --display_name
  • --params
  • --data_source
bqmk\--transfer_config\--project_id=project_id\--target_dataset=dataset\--display_name=name\--params='parameters'\--data_source=data_source--service_account_name=service_account_name

Where:

  • project_id is your project ID. If--project_id isn'tspecified, the default project is used.
  • dataset is the target dataset for the transfer configuration.
  • name is the display name for the transfer configuration. Thedata transfer name can be any value that lets you identify thetransfer if you need to modify it later.
  • parameters contains the parameters for the created transferconfiguration in JSON format. For example:--params='{"param":"param_value"}'. For Google Play, you must supply thebucket andtable_suffix, parameters.bucket is the Cloud Storage bucketthat contains your Play report files.
  • data_source is the data source:play.
  • service_account_name is the service account name used toauthenticate your data transfer. The service accountshould be owned by the sameproject_id used to create the transfer andit should have all of therequired permissions.
Caution: You cannot configure notifications using the command-linetool.

For example, the following command creates a Google Play data transfer namedMyTransfer using Cloud Storage bucketpubsite_prod_rev_01234567890987654321and target datasetmydataset. The data transfer is created in the defaultproject:

bq mk \--transfer_config \--target_dataset=mydataset \--display_name='My Transfer' \--params='{"bucket":"pubsite_prod_rev_01234567890987654321","table_suffix":"MT"}' \--data_source=play

The first time you run the command, you will receive a message like thefollowing:

[URL omitted] Please copy and paste the above URL into your web browser andfollow the instructions to retrieve an authentication code.

Follow the instructions in the message and paste the authentication code onthe command line.

Caution: When you create a Google Play data transfer using the command-line tool, thetransfer configuration is set up using the default value forSchedule(every 24 hours).

API

Use theprojects.locations.transferConfigs.createmethod and supply an instance of theTransferConfigresource.

Java

Before trying this sample, follow theJava setup instructions in theBigQuery quickstart using client libraries. For more information, see theBigQueryJava API reference documentation.

To authenticate to BigQuery, set up Application Default Credentials. For more information, seeSet up authentication for client libraries.

importcom.google.api.gax.rpc.ApiException;importcom.google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest;importcom.google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient;importcom.google.cloud.bigquery.datatransfer.v1.ProjectName;importcom.google.cloud.bigquery.datatransfer.v1.TransferConfig;importcom.google.protobuf.Struct;importcom.google.protobuf.Value;importjava.io.IOException;importjava.util.HashMap;importjava.util.Map;// Sample to create a play transfer config.publicclassCreatePlayTransfer{publicstaticvoidmain(String[]args)throwsIOException{// TODO(developer): Replace these variables before running the sample.finalStringprojectId="MY_PROJECT_ID";StringdatasetId="MY_DATASET_ID";Stringbucket="gs://cloud-sample-data";StringtableSuffix="_test";Map<String,Value>params=newHashMap<>();params.put("bucket",Value.newBuilder().setStringValue(bucket).build());params.put("table_suffix",Value.newBuilder().setStringValue(tableSuffix).build());TransferConfigtransferConfig=TransferConfig.newBuilder().setDestinationDatasetId(datasetId).setDisplayName("Your Play Config Name").setDataSourceId("play").setParams(Struct.newBuilder().putAllFields(params).build()).build();createPlayTransfer(projectId,transferConfig);}publicstaticvoidcreatePlayTransfer(StringprojectId,TransferConfigtransferConfig)throwsIOException{try(DataTransferServiceClientclient=DataTransferServiceClient.create()){ProjectNameparent=ProjectName.of(projectId);CreateTransferConfigRequestrequest=CreateTransferConfigRequest.newBuilder().setParent(parent.toString()).setTransferConfig(transferConfig).build();TransferConfigconfig=client.createTransferConfig(request);System.out.println("play transfer created successfully :"+config.getName());}catch(ApiExceptionex){System.out.print("play transfer was not created."+ex.toString());}}}
Warning: If you change the schema of a report, all files on that day must havethe same schema, or the data transfer for the entire day will fail.

Troubleshoot Google Play transfer set up

If you are having issues setting up your data transfer, seeTroubleshooting BigQuery Data Transfer Service transfer setup.

Query your data

When your data is transferred to BigQuery, the data iswritten to ingestion-time partitioned tables. For more information, seeIntroduction to partitioned tables.

If you query your tables directly instead of using the auto-generated views, youmust use the_PARTITIONTIME pseudocolumn in your query. For more information,seeQuerying partitioned tables.

Pricing

For information on Google Play data transfer pricing, see thePricing page.

Once data is transferred to BigQuery, standardBigQuerystorage andquery pricing applies.

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.