Amazon S3

Adapty’s integration with Amazon S3 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 Amazon S3 bucket as .csv files.
To set up this integration, you will need to follow a few simple steps in the AWS Console and Adapty dashboard.

Note

Schedule

Adapty sends your data every 24h at 4:00 UTC.

Each file will contain data for the events created for the entire previous calendar day in UTC. For example, the data exported automatically at 4:00 UTC on March 8th will contain all the events created on March 7th from 00:00:00 to 23:59:59 in UTC.

How to set up Amazon S3 integration

To start receiving data, you’ll need the following credentials:

  1. Access key ID
  2. Secret access key
  3. S3 bucket name
  4. Folder name inside the S3 bucket
Note

Nested directories

You can specify nested directories in the Amazon S3 bucket name field, e.g. adapty-events/com.sample-app

To integrate Amazon S3 go to Integrations -> Amazon S3, turn on a toggle from off to on, and fill out fields.

First of all set credentials to build a connection between Amazon S3 and Adapty profiles.

2b1a6e3-CleanShot_2023-03-24_at_14.51.272x.webp

In the Adapty Dashboard, the following fields are needed to set up the connection:

FieldDescription
Access Key IDA unique identifier that is used to authenticate a user or application’s access to an AWS service. Find this ID in the downloaded csv file .
Secret Access KeyA private key that is used in conjunction with the Access Key ID to authenticate a user or application’s access to an AWS service. Find this Key in the downloaded csv file .
S3 Bucket NameA globally unique name that identifies a specific S3 bucket within the AWS cloud. S3 buckets are a simple storage service that allows users to store and retrieve data objects, such as files and images, in the cloud.
Folder Inside the BuckerThe name of the folder that you want to have inside the selected S3 bucket. Please note that S3 simulates folders using object key prefixes, which are essentially folder names.

How to create Amazon S3 credentials

This guide will help you create the necessary credentials in your AWS Console.

1. Create Access Policy

First, navigate to the IAM Policy Dashboard in your AWS Console and select the option to Create Policy.

7af075c-CleanShot_2023-03-21_at_10.52.002x.webp

In the Policy editor, paste the following JSON and change adapty-s3-integration-test to your bucket name:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "AllowListObjectsInBucket",
            "Effect": "Allow",
            "Action": "s3:ListBucket",
            "Resource": "arn:aws:s3:::adapty-s3-integration-test"
        },
        {
            "Sid": "AllowAllObjectActions",
            "Effect": "Allow",
            "Action": "s3:*Object",
            "Resource": [
                "arn:aws:s3:::adapty-s3-integration-test/*",
                "arn:aws:s3:::adapty-s3-integration-test"
            ]
        },
        {
            "Sid": "AllowBucketLocation",
            "Effect": "Allow",
            "Action": "s3:GetBucketLocation",
            "Resource": "arn:aws:s3:::adapty-s3-integration-test"
        }
    ]
}
d4e474a-CleanShot_2023-03-21_at_10.56.212x.webp

After completing the policy configuration, you may choose to add tags (optional) and then click Next to proceed to the final step. In this step, you will name your policy and simply click on the Create policy button to finalize the creation process.

7dcb02f-CleanShot_2023-03-21_at_11.03.372x.webp

2. Create IAM user

To enable Adapty to upload raw data reports to your bucket, you will need to provide them with the Access Key ID and Secret Access Key for a user who has write access to the specific bucket.

To proceed with that, navigate to the IAM Console and select the Users section. From there, click on the Add users button.

bb612c8-CleanShot_2023-03-21_at_11.12.392x.webp

Give the user a name, choose Access key – Programmatic access, and proceed to permissions.

467ee4d-j6aoX.webp

For the next step, please select the Add user to group option and then click the Create group button.

bfd0e80-CleanShot_2023-03-21_at_11.24.592x.webp

Next, you need to assign a name to your User Group and select the policy that was previously created by you. Once you have selected the policy, click on the Create group button to complete the process.

df29c12-CleanShot_2023-03-21_at_11.28.052x.webp

After successfully creating the group, please select it and proceed to the next step.

1f3722e-CleanShot_2023-03-21_at_11.36.192x.webp

Since this is the final step for this section, you may proceed by simply clicking on the Create User button.

ea43722-CleanShot_2023-03-21_at_11.40.462x.webp

Lastly, you can either download the credentials in .csv format or alternatively, copy and paste the credentials directly from the dashboard.

bcf35e1-S3created.webp

Manual data export

In addition to the automatic event data export to Amazon S3, 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 S3 bucket manually. This allows you to have greater control over the data you export and when you export it.

The specified date range will be used to export the events created from Date A 00:00:00 UTC up to Date B 23:59:59 UTC.

466bd29-CleanShot_2023-03-21_at_12.35.252x.webp

Table structure

In AWS S3 integration, Adapty provides a 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.

Warning

Note that this structure may grow over time — with new data being introduced by us or by the 3rd parties we work with. Make sure that your code that processes it is robust enough and relies on the specific fields, but not on the structure as a whole.

Here is the table structure for the events:

Note

Adapty converts other currencies to USD at the currencylayer.com exchange rate (refreshed every 8 hours). The rate is fixed at the time of the transaction — future changes do not affect the conversion result.

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 the Apple App Store, Google Play Store, or Stripe. For a 12-month commitment plan, the value is <product_id>:monthly.
base_plan_idBase plan ID in the Google Play Store or price ID in Stripe.
developer_idDeveloper (SDK) ID of the paywall where the transaction originated.
ab_test_nameName of the A/B test where the transaction originated. For a crossplacement A/B test, the name of the test on one placement (<test name> child-N). To group a crossplacement test across placements, use ab_test_id.
ab_test_revisionRevision of the A/B test where the transaction originated.
paywall_nameName of the paywall where the transaction originated. For a flow, the ID of the paywall screen (scr_...). The flow name is in flow_name.
paywall_revisionRevision of the paywall where the transaction originated.
profile_countyProfile Country determined by Adapty, based on IP.
install_dateISO 8601 date when the installation happened.
idfvidentifierForVendor on iOS devices
idfaadvertisingIdentifier on iOS devices
advertising_idThe Advertising ID is a unique code assigned by the Android Operating System that advertisers might use to uniquely identify a user’s device
ip_addressDevice IP (can be IPv4 or IPv6, with IPv4 preferred when available). It is updated each time IP of the device changes.
cancellation_reason

A reason why the user canceled a subscription.

Can be:

iOS & Android voluntarily_cancelled, billing_error, refund

iOS price_increase, product_was_not_available, unknown, upgraded

Android new_subscription_replace, cancelled_by_developer

android_app_set_idAn AppSetId - unique, per-device, per developer-account user-resettable ID for non-monetizing advertising use cases.
android_idOn Android 8.0 (API level 26) and higher versions of the platform, a 64-bit number (expressed as a hexadecimal string), unique to each combination of app-signing key, user, and device. For more details, see Android developer documentation.
deviceThe end-user-visible device model name.
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.
attributesJSON of custom user attributes. This will include any custom attributes you’ve set up to send from your mobile app. To send it, enable the Send User Attributes option in the Integrations -> Webhooks page.
integration_idsAll integration IDs associated with a profile. Dictionary. Example: {‘mixpanel_user_id’: ‘mixpanelUserId-test’, ‘facebook_anonymous_id’: ‘facebookAnonymousId-test’}
variation_idUnique ID of the paywall where the transaction originated. For a flow, the ID of the paywall screen inside the flow, not the A/B test variant.
flow_idID of the flow where the transaction originated.
flow_nameName of the flow where the transaction originated.
flow_variation_idID of the flow variant on this placement, the same as flow.variationId in the SDK.
ab_test_idID of the A/B test where the transaction originated. For a crossplacement A/B test, the same on every placement.
ab_test_variant_idID of the A/B test variant where the transaction originated. Use it to split transactions by test variant.
ab_test_variant_nameName of the A/B test variant.
ab_test_parent_nameName of the crossplacement A/B test. Empty for other A/B tests.
virtual_currency_creditsThe virtual currency the purchase credited, as a JSON array in the same format as the webhook field. [] if the purchase credited nothing. Empty for other events and for imported historical data, except data imported before July 2, 2026, which shows []. The column is in the file only when Add virtual currency credits is on in the integration settings.

The flow and A/B test columns come at the end of the file, followed only by virtual_currency_credits when it’s on. Adapty calculates them at export time, so a name in the export can differ from the name in an earlier webhook event if you renamed the A/B test, variant, or flow in between. For what each column holds in each A/B test type, see Flow and A/B test fields.

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.
variation_idUnique ID of the paywall that was shown. For a flow, the ID of the paywall screen inside the flow, not the A/B test variant.
sourceWhere the paywall was shown: paywall for a paywall, flow for a paywall screen inside a flow.
flow_idID of the flow. Empty when source is paywall.
flow_nameName of the flow. Empty when source is paywall.
screen_idID of the paywall screen inside the flow. Empty when source is paywall.

To add the source, flow_id, flow_name, and screen_id columns, on the Paywall visits tab of the integration, select Add Flow columns to paywalls export. The columns come at the end of the file.

Virtual currency transactions

The virtual currency export sends each change of a virtual currency balance to your Amazon S3 bucket. Use it to load the full history of credits, spends, expiries, and refunds into your own data warehouse.

This export is separate from the events and paywall visits exports. It has its own switch and credentials, and its own bucket and folder settings.

Turn on the export

  1. Go to Integrations -> Amazon S3 and open the Virtual currency tab.
  2. Turn on Export virtual currency transactions to Amazon S3.
  3. Enter the credentials: the access key ID, the secret access key, the S3 bucket name, and the folder. The fields are the same as on the Paywall visits tab.

To export the virtual currency transactions of past days, use manual data export.

File and schedule

Every day, Adapty uploads 1 file with the virtual currency transactions of the previous calendar day in UTC. A transaction belongs to the day of its created_at time in UTC.

The file name is <app_id>_virtual_currency_<date>.csv, where <date> is 1 day after the day of the transactions, in YYYY-MM-DD format. For example, the file <app_id>_virtual_currency_2026-03-08.csv contains the transactions of March 7, 2026. Each export has its own file name. Keep each export in its own folder, so that a table or loader that reads a whole folder gets only one type of file. If the exports share a folder, select the files of this export by name: <app_id>_virtual_currency_*.csv.

The file is a UTF-8 .csv file with a header row. For a day with no transactions, the file has only the header row.

Each row is one balance change of one currency. A transaction that changes 2 currencies, such as an exchange of gold for gems, gives 2 rows with the same vc_transaction_id. Sandbox transactions are in the file too, with is_sandbox set to true.

When you save the settings, Adapty verifies the credentials of each export that is on. If the virtual currency credentials are invalid, Adapty doesn’t save the settings. The Save button saves the settings of all tabs, so Adapty doesn’t save your changes on the other tabs either.

The virtual currency export uses its own credentials. If its daily upload fails, the events and paywall visits uploads of the app still run.

Columns

The file has these columns, in this order. Adapty adds new columns only at the end of the file.

ColumnDescription
vc_transaction_idAdapty ID of the virtual currency transaction. All rows of one transaction have the same ID. This is not the Idempotency-Key of your API request.
created_atTime of the transaction, in UTC, in YYYY-MM-DD HH:MM:SS.ffffff+00:00 format, for example 2026-03-07 14:05:09.000000+00:00.
profile_idAdapty profile ID.
customer_user_idCustomer user ID of the profile at the time of the export. Empty if the profile has no customer user ID or no longer exists.
operationThe operation of the transaction: top_up, refund, spend, spend_reversal, reward, reward_reversal, exchange, expiry, migration, or adjustment. Empty for a server-side API transaction sent without operation.
transaction_typeHow Adapty recorded the transaction, for example store_purchase, subscription_renewal, trial_start, or api_transaction. subscription_renewal is used for each paid period of a subscription, the first one too.
currency_codeCode of the virtual currency.
amountChange of the balance, as an integer. Positive for a credit, negative for a debit.
balance_afterBalance of this currency on the profile after this change, as an integer. Never below 0.
storeStore of the transaction: app_store, play_store, stripe, paddle, adapty, or the name of a custom store. Empty if the transaction has no store.
store_transaction_idStore transaction ID of the purchase. The same as transaction_id in the events table for this purchase. Empty if the transaction is not linked to a store purchase.
store_original_transaction_idOriginal store transaction ID of the purchase. All renewals of a subscription have the same value. Filled on the rows of a store purchase, its refund, and its expiry.
product_idStore product ID of the purchase. Empty if the row has no store transaction, or if Adapty has no record of the purchase.
expires_atTime when the credited amount expires, in UTC, in YYYY-MM-DD HH:MM:SS.ffffff+00:00 format, for example 2026-04-07 14:05:09.000000+00:00. Filled only on credit rows that expire.
featureThe feature of the transaction.
reference_idThe reference_id of the transaction.
customer_placement_idThe customer_placement_id of the transaction.
is_sandboxtrue for a sandbox transaction, false for a production transaction.
metadataThe metadata of the transaction, as one JSON value in one cell. Empty if the transaction has no metadata.

Join with the events table

The virtual currency file has no prices. To get the price of a purchase that credited a currency, join the credit row with the events table:

  • Match store_transaction_id with transaction_id of the events table.
  • Match store too, but only for app_store, play_store, stripe, and paddle. For adapty and custom stores, the events table has an empty store.

This example query assumes that you loaded the virtual currency files into the vc_transactions table and the events files into the events table:

SELECT
  vc.vc_transaction_id,
  vc.created_at,
  vc.profile_id,
  vc.currency_code,
  vc.amount,
  e.event_type,
  e.product_id,
  e.revenue_usd,
  e.currency,
  e.revenue_local
FROM vc_transactions AS vc
LEFT JOIN events AS e
  ON e.transaction_id = vc.store_transaction_id
  AND (
    e.store = vc.store
    OR vc.store NOT IN ('app_store', 'play_store', 'stripe', 'paddle')
  )
  AND e.event_type IN (
    'subscription_initial_purchase',
    'subscription_started',
    'subscription_renewed',
    'trial_started',
    'trial_converted',
    'non_subscription_purchase'
  )
WHERE vc.amount > 0
  AND COALESCE(vc.store_transaction_id, '') <> '';

The query lists the default event names. A subscription start is subscription_initial_purchase in an integration created since mid-September 2025, and subscription_started in an earlier one. If you changed the event names in the events export settings, use your names in the query.

A credit row has no matching event if the events export is off, if the events export settings exclude or rename the event type of the purchase, or if Exclude Historical Events excludes the event.

One purchase can credit more than one currency. Each currency gets its own credit row, and all these rows join the same event. To sum revenue, count each store_transaction_id once.

Limitations

  • No prices or refund amounts: The virtual currency file has no purchase price and no refund amount. To get the price, join the credit row with the events table.
  • Don’t add up credits from the two files: The virtual_currency_credits column of the events file and the credit rows of the virtual currency file show the same purchase credits. To count credits, use one of them, not both. Their totals can differ: the events file has only the credits of purchases, and only for the events that its settings export, while the virtual currency file has every balance change, including grants through the API and manual adjustments in the dashboard.
  • No link between a spend and its credits: The file doesn’t show which credits a spend used, for example, purchased or granted credits.
  • Refund rows show only the credits taken back: A refund row shows the credits that Adapty took back from the balance. Its amount can be smaller than the credits that the purchase granted, for example, when the user spent part of them. If no credits were left, the file has no refund row.
  • No refund row for a subscription upgrade: A refund that comes from a subscription upgrade takes back no credits. The file has no refund row for it.

Events and tags

You can manage what data is communicated by the integration. The integration offers the following configuration options:

SettingDescription
Exclude Historical EventsOpt to exclude events that occurred before the user installed the app with Adapty SDK. This prevents duplication of events and ensures accurate reporting. For instance, if a user activated a monthly subscription on January 10th and updated the app with Adapty SDK on March 6th, Adapty will omit events before March 6th and retain subsequent events.
Include events without profileOpt to include transactions that are not linked to a user profile in Adapty. These may include purchases made before Adapty SDK was installed or transactions received from store server notifications that cannot be immediately associated with a specific user.
Send User AttributesIf you wish to send user-specific attributes, like language preferences, and your OneSignal plan supports more than 10 tags, select this option. Enabling this allows the inclusion of additional information beyond the default 10 tags. Note that exceeding tag limits may result in errors.
Add virtual currency creditsAdd the virtual_currency_credits column to the end of each row of the events file (see Table structure). The option also applies to the manual data export, so you can export past days again to get the column.
s3-settings.webp

Below the integration settings, there are three groups of events you can export, send, and store in Amazon S3 from Adapty. Simply turn on the ones you need. Check the full list of the events offered by Adapty here.

fd5ccb9-CleanShot_2023-08-17_at_14.49.282x.webp