Google Cloud Storage

Learn how to set up Google Cloud Storage export

Adapty's integration with Google Cloud Storage allows you to store event and paywall visit data securely in one central location. You will be able to save your subscription events to your Google Cloud Storage bucket as .csv files.
To set up this integration, you will need to follow a few simple steps in the Google Cloud Console and Adapty dashboard.

📘

Schedule

Adapty sends your data to Google Cloud Storage every 24h at 4:00 UTC.

How to set up Google Cloud storage integration

To integrate Google Cloud Storage go to Integrations > Google Cloud Storage, turn on a toggle from off to on, and fill out fields.

First of all set credentials to build a connection between Google Cloud Storage and Adapty profiles.

Google Cloud Storage - Photo 1

Adapty - Google Cloud Storage

In the Adapty Dashboard the following fields are needed to setup the connection:

  1. Google Cloud Client ID - an unique identifier assigned to your Google Cloud project when you create a new client in the Google Cloud Console. Find this ID in the downloaded private JSON key file under the client_id field.

  2. Google Cloud Project ID - an user-assigned identifier for your Google Cloud project. Find this ID in the downloaded private JSON key file under the project_id field.

  3. Google Cloud Service Account Private Key ID - an unique identifier assigned to your private key when you create a new service account in the Google Cloud Console. Find this ID in the downloaded private JSON key file under the private_key_id field.

  4. Google Cloud Service Account Private Key - an unique private key for your service account. Find this ID in the downloaded private JSON key file under the private_key field.

  5. Google Cloud Bucket Name - the name of the bucket in Google Cloud Storage where you want to store your data. It should be unique within the Google Cloud Storage environment and should not contain any spaces.

  6. Email - This is the email address associated with your service account in Google Cloud Console. It is used to grant access to resources in your project.

  7. Folder inside the bucket - This is the name of the folder inside the bucket where you want to store your data. It should be unique within the bucket and can be used to organize your data. This field is optional to fill.

Create Google Cloud Storage credentials

This guide will help you create necessary credentials in your Google Cloud Platform Console.

In order for Adapty to upload raw data reports to your designated bucket, the service account's key is required, as well as write access to the corresponding bucket. By providing the service account's key and granting write access to the bucket, you allow Adapty to securely and efficiently transfer the raw data reports from its platform to your storage environment.

🚧

Please note that we only support Service Account HMAC key authorization, means it's essential to ensure that your Service Account HMAC key has the "Storage Object Viewer", "Storage Legacy Bucket Writer" and "Storage Object Creator" roles added to it to enable proper access to Google Cloud Storage.

1. For the first step you need to go to the IAM section of your Google Cloud account and choose the relevant project or create a new one.

Google Cloud Storage - Photo 2

GCS - Select Project

2. Next create a new service account for the Adapty by clicking on the "+ CREATE SERVICE ACCOUNT" button.

Google Cloud Storage - Photo 3

GCS - Create button

3. Fill out the fields in the first step, as access will be granted at a later stage. In order to read more details about this page read the documentation here.

Google Cloud Storage - Photo 4

GCS - Add Service Account

4. To create and download a private JSON key, navigate to the KEYS section and click on the "ADD KEY" button.

Google Cloud Storage - Photo  5

Add Key JSON- GCS

5. In the DETAILS section, locate the Email value linked to the recently created service account and make a copy of it. This information will be necessary for the upcoming steps to authorize the account and allow it to write to the bucket.

Google Cloud Storage - Photo 6

GCS - Service Account Details

6. To proceed go to the Google Cloud Storage's Buckets page and either select an existing bucket or create a new one to store the Event or Visuts Data reports from Adapty. Then navigate to the PERMISSIONS section and select the option to GRANT ACCESS.

Google Cloud Storage - Photo 7

GCS - Grant Access

7. In the PERMISSIONS section, input the Email of the service account obtained in the fifth step mentioned earlier, then choose the Storage Object Creator role. Finally, click on SAVE to apply the changes.

Google Cloud Storage - Photo 8

GCS - Grant Access

Remember to keep the name of the bucket for future reference.

8. After passing these steps have successfully completed the necessary setup steps in the Google Cloud Console! The final step involves entering the bucket's name, accessing the JSON file containing the downloaded private key, and extracting the required field values for use in Adapty.

Google Cloud Storage - Photo 9

GCS - private JSON

Manual data export

In addition to the automatic event data export to Google Cloud Storage, Adapty also provides a manual file export functionality. With this feature, you can select a specific time interval for the event data and export it to your GCS bucket manually. This allows you to have greater control over the data you export and when you export it. Please note that the file for today will have incomplete data.

Google Cloud Storage - Photo 10

GCS - Manual Export

Table structure

In Google Cloud Storage integration, Adapty provides table to store historical data for transaction events and paywall visits. The table contains information about the user profile, revenue and proceeds, and the origin store, among other data points. Essentially, these tables log all transactions generated by an app for a given time period.
Here is the table structure for the events:

ColumnDescription
profile_idAdapty user ID.
event_typeLower cased event name. Refer to the Events section to learn event types.
event_datetimeISO 8601 date.
transaction_idA unique identifier for a transaction such as a purchase or renewal.
original_transaction_idThe transaction identifier of the original purchase.
subscription_expires_atThe Expiration date of subscription. Usually in the future.
environmentCould be Sandbox or Production.
revenue_usdRevenue in USD. Can be empty.
proceeds_usdProceeds in USD. Can be empty.
net_revenue_usdNet revenue (income after taxes) in USD. Can be empty.
tax_amount_usdAmount of money deducted for taxes in USD. Can be empty.
revenue_localRevenue in local currency. Can be empty.
proceeds_localProceeds in local currency. Can be empty.
net_revenue_localNet revenue (income after taxes) in local currency. Can be empty.
tax_amount_localAmount of money deducted for taxes in local currency. Can be empty.
customer_user_idDeveloper user ID. For example, it can be your user UUID, email, or any other ID. Null if you didn't set it.
storeCould be app_store or play_store.
product_idProduct id in Apple/Google store.
developer_idDeveloper (SDK) ID of the paywall where the transaction originated.
ab_test_nameName of the A/B test where the transaction originated.
ab_test_revisionRevision of the A/B test where the transaction originated.
paywall_nameName of the paywall where the transaction originated.
paywall_revisionRevision of the paywall where the transaction originated.
profile_countryProfile Country determined by Adapty, based on IP.
install_dateISO 8601 date when the installation happened.
idfvidentifierForVendor on iOS devices
currencyThe 3-letter currency code (ISO-4217) of the transaction.
store_countryProfile Country determined by Apple/Google store.
attribution_sourceAttribution source.
attribution_network_user_idID assigned to the user by attribution source.
attribution_statusCan be organic, non_organic or unknown
attribution_channelMarketing channel name.
attribution_campaignMarketing campaign name.
attribution_ad_groupAttribution ad group.
attribution_ad_setAttribution ad set.
attribution_creativeAttribution creative keyword.

And here is the table structure for the paywall visits:

ColumnDescription
profile_idAdapty user ID.
customer_user_idDeveloper user ID. For example, it can be your user UUID, email, or any other ID. Null if you didn't set it.
profile_countryProfile Country determined by Apple/Google store.
install_dateISO 8601 date when the installation happened.
storeCould be app_store or play_store.
paywall_showed_atThe date when the paywall has been displayed to the customer.
developer_idDeveloper (SDK) ID of the paywall where the transaction originated.
ab_test_nameName of the A/B test where the transaction originated.
ab_test_revisionRevision of the A/B test where the transaction originated.
paywall_nameName of the paywall where the transaction originated.
paywall_revisionRevision of the paywall where the transaction originated.

## Events and tags

Below the credentials, there are three groups of events you can export, send, and store in Google Cloud Storage from Adapty. Simply turn on the ones you need. Check the full list of the events offered by Adapty here.

Subscriptions, trials, issues events in Adapty integration interface

Subscriptions, trials, issues events in Adapty integration interface