Skip to main content

AppsFlyer data integration solution

Last updated 10/05/2026

Last updated: 2023-04-04

1. Integration plan overview​

tip

Note that data generated by third-party data integration counts toward the cluster's data consumption

Summary​

This document describes how to send AppsFlyer data back to Agentic Engine (hereinafter the AE system). This solution supports multiple AppsFlyer data integration methods. The following table shows the features and data types of each method. You can click a name to jump to the corresponding section:

InterfaceData granularityAPI typeProductizedData update frequencyRequest limits

Push API user data

User level

Push

Yes

Real time

No limit

Pull API user-level data API

User level

Pull

No

Real time

  • Up to 1M rows per request
  • Up to 24 requests per app per day
  • Up to 120 requests per account per day

Pull API aggregated data

Aggregated data

Pull

No

Real time

  • Up to 1 request per minute
  • Pull time range within 0-2 days: no limit
  • Pull time range of 3 days or more:
    • Up to 24 requests per app per day
    • Up to 120 requests per account per day

Master API

Aggregated dataPull

No

By day

  • No row limit per request
  • No limit on daily requests

Cohort API

Aggregated dataPullNoBy day

No limit

Data LockerUser level / aggregated dataPull-By day/hourSubject to the limits of the cloud storage used for the export
warning

Note that some platforms restrict some fields of user-level data from being sent back, including attribution information, revenue data, and cost data

tip

Some of the APIs are paid AppsFlyer features. Before you use them, ask your account manager at AppsFlyer about your access to these APIs.

2. Push API user-level data API (productized)​

Basic interface information

InterfaceAPI typeProductizedData granularityAttributionCostRevenueImpressionsClicksConversions
Push APIPushYesUser levelYesYesYesYesYes

Push API gets AppsFlyer user-level data in real time, including impression, click, install, and revenue data. Cost data may not be available because of data restrictions on the AF platform.

tip

Note that Push API integration has been productized in the AE system backend. We recommend that you follow the related product documentation and configure the integration in the UI.

Before you connect Push API user-level data, make sure you have read the AE system user identification rules and understand how the AE system identifies a user through #distinct_id and #account_id. The data integration process of the AppsFlyer Push API is shown in the image below:

View original image

2.1 Configure the client SDK​

To connect Push API user-level data with the user data of the AE project, you need to report the account ID and distinct ID of the AE project in the AppsFlyer SDK. The following describes how to configure the client SDK.

Option 1 (automatic integration):

tip

If the AE SDK version you integrated is 2.8.0~2.8.1, you can use this option directly

If the AE SDK version you integrate is 2.8.2 or later, you also need to install the third-party data plugin

This option is an automatic integration. After you initialize the AE client SDK, call the following code to enable it. For details, see Android SDK third-party data and iOS SDK third-party data

// Initialize the AE SDK
ThinkingAnalyticsSDK instance = ThinkingAnalyticsSDK.sharedInstance(this, TA_APP_ID, TA_SERVER_URL);

// Enable AppsFlyer ID association in the AE SDK
instance.enableThirdPartySharing(TDThirdPartyShareType.TD_APPS_FLYER);

// We strongly recommend that you use setCustomerUserId() to set the distinct ID again
String distinctId = instance.getDistinctId();
AppsFlyerLib.getInstance().setCustomerUserId(distinctId);

// Initialize the AppsFlyer SDK
AppsFlyerLib.getInstance().init("appid", null, this);
AppsFlyerLib.getInstance().start(this);

// After calling login in the AE SDK to set the account ID, sync the data to the AF SDK again
instance.login("account_id");
instance.enableThirdPartySharing(TDThirdPartyShareType.TD_APPS_FLYER);

If you call the login() or identify() method of the AE SDK, call enableThirdPartySharing() again to sync the data.

Note: If you also need to call the setAdditionalData() method of the AppsFlyer SDK, calling it multiple times overwrites the previous parameters. In this case, you can pass the parameters to the AE SDK, which concatenates and merges them internally.

Map<String, Object> additionalData = new HashMap<>();
additionalData.put("af_test_key1", "test1");
additionalData.put("af_test_key2", "test2");
instance.enableThirdPartySharing(
TDThirdPartyShareType.TD_APPS_FLYER,
additionalData
);

This option works by automatically calling AppsFlyer's setAdditionalData() method internally and passing in the distinct ID and account ID of the AE project.

Option 2 (manual integration):

For manual integration, you need to use setAdditionalData in the AppsFlyer SDK to configure the distinct ID and account ID of the AE project. The following is a Java code sample:

// Initialize the AE SDK
ThinkingAnalyticsSDK instance = ThinkingAnalyticsSDK.sharedInstance(this, TA_APP_ID, TA_SERVER_URL);

// Get the AE distinct ID, which corresponds to #distinct_id in AE
String distinctId = instance.getDistinctId();

// Set the distinct ID in the AF SDK through setAdditionalData()
HashMap<String,Object> CustomDataMap = new HashMap<>();
CustomDataMap.put("ta_distinct_id",distinctId);
AppsFlyerLib.getInstance().setAdditionalData(CustomDataMap);

// We strongly recommend that you use setCustomerUserId() to set the distinct ID again
AppsFlyerLib.getInstance().setCustomerUserId(distinctId);

// Initialize the AppsFlyer SDK
AppsFlyerLib.getInstance().init("appid", null, this);
AppsFlyerLib.getInstance().start(this);
...

// After calling login in the AE SDK to set the account ID, sync the data to the AF SDK again
String accountId = "your_account_id";
instance.login(accountId);
HashMap<String,Object> CustomDataMap = new HashMap<>();
CustomDataMap.put("ta_distinct_id", distinctId);
CustomDataMap.put("ta_account_id",accountId);
AppsFlyerLib.getInstance().setAdditionalData(CustomDataMap);

After these settings, custom_data in the returned data carries the two fields ta_distinct_id and ta_account_id, and customer_user_id equals the distinct ID.

Note: If you use the productized configuration method to connect AppsFlyer Push API data, enter the following in the association fields:

  • Account ID association field: custom_data.ta_account_id
  • Distinct ID association field: customer_user_id,custom_data.ta_distinct_id

2.2 Configure the callback URL​

Next, log in to the AppsFlyer dashboard with an admin account, find the Push API section under Integration - API Access, and set the callback URL as follows:

  • Push API Version

    • Select version 2.0
  • HTTP method

    • The AE system supports both POST and GET callbacks. We recommend POST
  • Endpoint URL

    • ThinkingAI staff will provide you with the endpoint address for receiving data
  • Event Messages

    • You need to select at least Install and Install in-app events. If you have other event data to send back, select it as needed
  • Message Fields

    • The message fields must include at least the following:

      • Mobile attribution fields: media_source, channel, af_adset, af_ad, and so on
      • User identification ID fields: custom_data, customer_user_id, event_value, and so on
      • Fields to use as event properties or user properties
      • Event fields: event_time_selected_timezone
  • In-app events

    • Select the events to send back as needed, such as the ta_registration event reported by the client
warning

Note that if you need Facebook data, you must accept the Facebook data use agreement (Terms of Service) in the Facebook channel settings in the AF dashboard. Otherwise, you can't get Facebook user-level data.

2.3 Data ingestion​

2.3.1 User identification rules​

Based on the logic of the user identification fields you set in the client SDK earlier, you need to determine the corresponding user identification rules so that the user-level data sent back by Push API can be associated with the corresponding users in the AE project.

By default, we look for user identification fields in the callback data according to the following rules:

  • Step 1: Check whether the custom_data field contains ta_account_id / ta_distinct_id, that is, the fields set by setAdditionalData()
  • Step 2: Check whether the event_value field contains ta_account_id / ta_distinct_id, that is, the fields set in AppsFlyer custom events
  • Step 3: If the event is an Install event (event_name: install), check the customer_user_id field. If it exists, customer_user_id is used as #distinct_id, that is, the field set by setCustomerUserId()

At each step, if any valid ID is obtained, the remaining steps are skipped. If no valid user ID is obtained after all 3 steps, by default the record is treated as invalid and discarded. If you want to keep this data, contact ThinkingAI staff to configure it. This data is then recorded in the event table with the fixed distinct ID "without_id", and no user properties are stored for it

If the user identification fields you set differ from the above, note them in the data integration configuration template.

2.3.2 Data ingestion rules​

By default, the data sent back is not written as event data. If you need it written as event data, all received events are written as event data. The following are the ingestion rules for event data:

  • Event data is attributed to the corresponding AE user based on the user identification rules
  • The time and time zone are taken from the event_time_selected_timezone field in the data: the time is used as #event_time, and the time zone is written as #zone_offset. If this field is empty, event_time is used as #event_time, and the time zone #zone_offset is set to 0
  • The event name of the data is the event's name in AppsFlyer
  • All other fields are stored

2.3.3 User property ingestion settings​

By default, we read the values of the following four fields from the data and set them as user properties:

AppsFlyer fieldAE standardized fieldDescription
media_sourcete_ads_object.media_sourceChannel
campaignte_ads_object.campaign_nameCampaign
af_adsette_ads_object.ad_group_nameAd group
af_adte_ads_object.ad_nameAd

In addition, you can customize the user properties to ingest, including their ingestion rules (that is, whether to use user_set or user_setOnce). If you need to customize user properties, note them in the data integration configuration template.

2.4 Data integration configuration template​

After reading the documentation above, we recommend that you fill in the following template and send it to your customer success manager at ThinkingAI:

Interface: AppsFlyer Push API
--------
Company name: XXX
AE project environment: (SAAS/on-premises)
AE project name: XXX
AE project APP ID: XXX
Data receiving URL push_url: XXX
---------
User identification rule: XXX as the distinct ID/account ID (leave blank to use the default)
Ingest events: No/Yes
Keep data without a user identification ID: No/Yes (takes effect only when events are ingested)
Ingested user properties: XXX, XXX (leave blank to use the default)

3. Pull API user-level data​

Basic interface information

InterfaceAPI typeProductizedData granularityAttributionCostRevenueImpressionsClicksConversions
Pull API Raw DataPullNoUser levelYesYesYesYes

Pull API Raw Data is a pull-based user-level data API that is well suited to pulling historical user-level data.

3.1 Before you begin​

3.1.1 Get the API Token​

Log in with an admin account, find API Access in the AppsFlyer sidebar menu, and get the V2.0 API token for Pull API Raw Data.

3.1.2 Get the App ID​

You can find your app's App ID under My Apps in the AppsFlyer dashboard. On Android, it starts with com., such as com.demoapp.ta; on iOS, it starts with id, such as id12345678

3.1.3 Configure the client SDK​

To connect Pull API user-level data with the user data of the AE project, you need to report the account ID and distinct ID of the AE project in the AppsFlyer SDK. The following describes how to configure the client SDK.

Option 1 (automatic integration):

tip

If the AE SDK version you integrated is 2.8.0~2.8.1, you can use this option directly

If the AE SDK version you integrate is 2.8.2 or later, you also need to install the third-party data plugin

This option is an automatic integration. After you initialize the AE client SDK, call the following code to enable it. For details, see Android SDK third-party data and iOS SDK third-party data

// Initialize the AE SDK
ThinkingAnalyticsSDK instance = ThinkingAnalyticsSDK.sharedInstance(this, TA_APP_ID, TA_SERVER_URL);
// Enable AppsFlyer ID association
instance.enableThirdPartySharing(TDThirdPartyShareType.TD_APPS_FLYER);

// Initialize the AppsFlyer SDK
AppsFlyerLib.getInstance().init("appid", null, this);
AppsFlyerLib.getInstance().start(this);

// We strongly recommend that you use setCustomerUserId() to set the distinct ID again
String distinctId = instance.getDistinctId();
AppsFlyerLib.getInstance().setCustomerUserId(distinctId);

// After calling login to set the account ID, sync the data again (optional)
instance.login("account_id");
instance.enableThirdPartySharing(TDThirdPartyShareType.TD_APPS_FLYER);

If you call the login() or identify() method of the AE SDK, call enableThirdPartySharing() again to sync the data.

Note: If you also need to call the setAdditionalData() method of the AppsFlyer SDK, calling it multiple times overwrites the previous parameters. In this case, you can pass the parameters to the AE SDK, which concatenates and merges them internally.

Map<String, Object> additionalData = new HashMap<>();
additionalData.put("af_test_key1", "test1");
additionalData.put("af_test_key2", "test2");
instance.enableThirdPartySharing(
TDThirdPartyShareType.TD_APPS_FLYER,
additionalData
);

This option works by automatically calling AppsFlyer's setAdditionalData() method internally and passing in the distinct ID and account ID of the AE project.

Option 2 (manual integration):

For manual integration, you need to use setAdditionalData in the AppsFlyer SDK to configure the distinct ID and account ID of the AE project. The following is a Java code sample:

// Initialize the AE SDK
ThinkingAnalyticsSDK instance = ThinkingAnalyticsSDK.sharedInstance(this, TA_APP_ID, TA_SERVER_URL);

// Get the AE distinct ID, which corresponds to #distinct_id in AE
String distinctId = instance.getDistinctId();
// Your account ID (or character ID), which corresponds to #account_id in AE
String accountId = "your_account_id";

// Deploy at install
HashMap<String,Object> CustomDataMap = new HashMap<>();
CustomDataMap.put("ta_distinct_id",distinctId);
AppsFlyerLib.getInstance().setAdditionalData(CustomDataMap);

// We strongly recommend that you use setCustomerUserId() to set the distinct ID again
AppsFlyerLib.getInstance().setCustomerUserId(distinctId);
...

// Deploy at registration
HashMap<String,Object> CustomDataMap = new HashMap<>();
CustomDataMap.put("ta_distinct_id", distinctId);
CustomDataMap.put("ta_account_id",accountId);
AppsFlyerLib.getInstance().setAdditionalData(CustomDataMap);

After these settings, custom_data in the returned data carries the two fields ta_distinct_id and ta_account_id, and customer_user_id equals the distinct ID.

3.2 Included fields​

By default, Pull API Raw Data supports pulling the following data:

FieldDisplay nameRetrieved by defaultType
Attributed Touch TypeAttribution type (impression, click)Yes
Attributed Touch TimeAttribution timeYesTime
Install TimeActivation timeYesTime
Event TimeEvent timeYesTime
Event NameEvent nameYes
Event ValueEvent valueYes
Event RevenueEvent revenueYesNumeric
Event Revenue CurrencyEvent revenue currencyYes
Event Revenue USDEvent revenue (USD)YesNumeric
Event SourceEvent sourceYes
Is Receipt ValidatedWhether receipt validation is enabled
PartnerPartnerYes
Media SourceMedia sourceYes
ChannelSub-channelYes
KeywordsKeywordsYes
CampaignCampaign nameYes
Campaign IDCampaign IDYes
AdsetAd group nameYes
Adset IDAd group IDYes
AdAd creative nameYes
Ad IDAd creative IDYes
Ad TypeAd typeYes
Site IDSite IDYes
Sub Site IDSub-site IDYes
Sub Param [1-5]Sub-parameter [1-5]
Cost ModelCost model (CPC/CPI/CPM/Other)Yes
Cost ValueCost valueYesNumeric
Cost CurrencyCost currencyYes
Contributor [1-3] PartnerContributor [1-3] partner
Contributor [1-3] Media SourceContributor [1-3] media source
Contributor [1-3] CampaignContributor [1-3] campaign
Contributor [1-3] Touch TypeContributor [1-3] attribution type
Contributor [1-3] Touch TimeContributor [1-3] attribution timeTime
RegionRegionYes
Country CodeCountry codeYes
StateState/ProvinceYes
CityCityYes
Postal CodePostal code
DMADMA code
IPIP addressYes
WIFIWhether Wi-Fi is onYes
OperatorMobile operatorYes
CarrierMobile carrierYes
LanguageLanguageYes
AppsFlyer IDAppsFlyer IDYes
Advertising IDAdvertising IDYes
IDFAIDFAYes
Android IDAndroid IDYes
Customer User IDCustomer User IDYes
IMEIIMEIYes
IDFVIDFVYes
PlatformPlatformYes
Device TypeDevice TypeYes
OS VersionOSYes
App VersionApp versionYes
SDK VersionSDK versionYes
App IDApp IDYes
App NameApp nameYes
Bundle IDBundle IDYes
Is RetargetingIs retargetingYes
Retargeting Conversion TypeRetargeting conversion typeYes
Attribution LookbackAttribution lookback
Reengagement WindowRe-engagement window
Is Primary AttributionIs primary attribution
User AgentUser agent
HTTP ReferrerHTTP Referrer
Original URLOriginal URLYes

3.3 API parameters​

  • Time:

    • Data is pulled by day (only data from the last 90 days can be pulled)
    • The default time zone of the data is UTC

3.4 Data ingestion rules​

The Pull API user-level data API ingests several types of data. The processing rules for each type are as follows:

  • Installs data

    • Pulls Installs data that contains only user acquisition (UA), and Organic Installs data
    • Data is written as user properties by default
    • Data can also be written as events, with the event name af_install
    • User identification fields are determined by the user identification field configuration. If no user identification rule is configured, customer_user_id in the data is used as the distinct ID by default. If no user identification field is found, the record is discarded.
    • All fields are ingested
  • Ad Revenue

    • Pulls Attributed ad revenue and Organic ad revenue. Attributed ad revenue pulls both user acquisition (UA) and retargeting data
    • Data is written as events with the event name af_ad_revenue_raw
    • The Event Time in the data, that is, the time the event occurred, is used as the event's #event_time
    • User identification fields are determined by the user identification field configuration. If no user identification rule is configured, customer_user_id in the data is used as the distinct ID by default. If no user identification field is found, the record is discarded.
    • All fields are ingested

3.5 Data integration configuration template​

After reading the documentation above, we recommend that you fill in the following template and send it to your customer success manager at ThinkingAI:

Interface: AppsFlyer Pull API Raw Data
--------
Company name: XXX
AE project environment: (SAAS/on-premises)
AE project name: XXX
AE project APP ID: XXX
Data receiving URL push_url: XXX
---------
AppsFlyer API Token: xxxxxxxx
AppsFlyer App ID: xxxxxxxx
---------
User identification rule: XXX as the distinct ID/account ID (leave blank to use the default)
Data to connect: Install, Ad Revenue
Install event properties to write to user properties: xxx, xxx (leave blank to use the default)

Time range for historical data pull: yyyy/mm/dd - yyyy/mm/dd (only data from the last 90 days can be pulled)
Scheduled pull: pull the previous day's data at X:00 every day

4. Pull API aggregated metrics API​

Basic interface information

InterfaceAPI typeProductizedData granularityAttributionCostRevenueImpressionsClicksConversions
Pull API aggregated metricsPullNoAggregated dataYesYesYesYesYes

The AppsFlyer Pull API aggregated metrics API provides different types of aggregated metric data. The AE system currently supports the Partners (by date) and Geo (by date) data types.

4.1 Before you begin​

4.1.1 Get the API Token​

Log in with an admin account, find API Access in the AppsFlyer sidebar menu, and get the V2.0 API token for Pull API.

4.1.2 Get the App ID​

You can find your app's App ID under My Apps in the AppsFlyer dashboard. On Android, it starts with com., such as com.demoapp.ta; on iOS, it starts with id, such as id12345678

4.2 Included fields​

4.2.1 Partner (by date) data​

This section describes data of the Partner (by date) type. This report is based on LTV data, that is, it pulls the subsequent data of new users who installed within the specified time period.

Because Facebook's data format differs from that of other media sources, the AE system pulls Facebook-only data and data from all platforms separately. The following fields are available from Partner (by date):

Field nameIngested nameFacebook data onlyAll-platform data
Date#event_time✓✓
Agency/PMD (af_prt)agency_pmd_af_prt✓✓
Media Source (pid)media_source_pid✓✓
Campaign

campaign_name (Facebook)

campaign_c (all platforms)

✓✓
Campaign IDcampaign_id

✓

Adgroup IDadgroup_id✓
Adgroup Nameadgroup_name✓
Adset IDadset_id✓
Adset Nameadset_name✓
ARPUarpu✓✓
Average eCPIaverage_ecpi✓✓
Clicksclicks✓✓
Conversion Rateconversion_rate✓✓
CTRctr✓✓
{your event name}(Unique users){your_event_name}_unique_users✓✓
{your event name} (Event counter){your_event_name}_event_counter✓✓
{your event name} (Sales in XXX){your_event_name}_sales_in_usd✓✓
Impressionsimpressions✓✓
Installsinstalls✓✓
Loyal Usersloyal_users✓✓
Loyal Users/Installsloyal_users_installs✓✓
ROIroi✓✓
Sessionssessions✓✓
Total Costtotal_cost✓✓
Total revenuetotal_revenue

✓

✓

4.2.2 Geo (by date) data​

This section describes data of the Geo (by date) type. This report is based on LTV data, that is, it pulls the subsequent data of new users who installed within the specified time period.

Because Facebook's data format differs from that of other media sources, the AE system pulls Facebook-only data and data from all platforms separately. The following fields are available from Geo (by date):

Field nameIngested nameFacebook data onlyAll-platform data
Countrycountry✓✓
Date#event_time✓✓
Agency/PMD (af_prt)agency_pmd_af_prt✓✓
Media Source (pid)media_source_pid✓✓

Campaign

campaign_name (Facebook)

campaign_c (all platforms)

✓

✓
Campaign IDcampaign_id✓
Adgroupadgroup_id✓
Adgroup Nameadgroup_name✓
Adset IDadset_id✓
Adset Nameadset_name✓
ARPUarpu✓✓
Clicksclicks✓✓
Conversion Rateconversion_rate✓✓
{your event name}(Unique users){your_event_name}_unique_users✓✓
{your event name} (Event counter){your_event_name}_event_counter✓✓
{your event name} (Sales in XXX){your_event_name}_sales_in_usd✓✓
Installsinstalls✓✓
Loyal Usersloyal_users✓✓

Sessions

sessions✓✓

Total revenue

total_revenue

✓

✓

4.3 API parameters​

  • Time:

    • Data is pulled by day
    • The default time zone of the data is UTC

4.4 Data ingestion rules​

By default, we write the pulled data to the AE project as events:

  • Because the Pull API aggregated metrics API returns aggregated data, we use a fixed value as the user identifier. You can think of all the data as attached to one virtual user

  • The Date field in the data, that is, the user's install date, is used as the event's #event_time

  • The event names in the data are:

    • Partner (by date)

      • appsflyer_facebook_partner_by_date (Facebook data)
      • appsflyer_partner_by_date (all-platform data)
    • Geo (by date)

      • appsflyer_facebook_geo_by_date (Facebook data)
      • appsflyer_geo_by_date (all-platform data)
  • All other fields are ingested

4.5 Data integration configuration template​

After reading the documentation above, we recommend that you fill in the following template and send it to your customer success manager at ThinkingAI:

Interface: AppsFlyer Pull API aggregated data API
--------
Company name: XXX
AE project environment: (SAAS/on-premises)
AE project name: XXX
AE project APP ID: XXX
Data receiving URL push_url: XXX
---------
AppsFlyer API Token: xxxxxxxx
AppsFlyer App ID: xxxxxxxx
---------
Data pull time zone: XXX (UTC by default)
Data pull type: Partner (by date)/Geo (by date)

Time range for historical data pull: yyyy/mm/dd - yyyy/mm/dd
Scheduled pull: pull the previous day's data at X:00 every day

5. Master API​

Basic interface information

InterfaceAPI typeProductizedData granularityAttributionCostRevenueImpressionsClicksConversions
Master APIPullNoAggregated dataYesYesYesYes

Master API supports custom analysis dimensions and aggregated metrics, and is more flexible than the Pull API aggregated metrics API.

5.1 Before you begin​

5.1.1 Get the API Token​

Log in with an admin account, find API Access in the AppsFlyer sidebar menu, and get the V2.0 API token for Master API.

5.1.2 Get the App ID​

You can find your app's App ID under My Apps in the AppsFlyer dashboard. On Android, it starts with com., such as com.demoapp.ta; on iOS, it starts with id, such as id12345678

5.2 Included fields​

Master API includes many types of metrics. The commonly used metric categories are LTV KPIs, Retention KPIs, and Cohort KPIs. Because Cohort KPIs support fewer analysis dimensions than the other metric categories, the AE system pulls data with and without Cohort KPIs separately. The following are the fields covered by these two types of data:

  • Analysis dimensions
Field nameaf_groupingsIngested nameExcluding Cohort KPIs dataIncluding Cohort KPIs data
App IDapp_idapp_id✓✓
Media Sourcepidmedia_source✓✓
Agencyaf_prtpartner✓
Campaignccampaign✓✓
Adsetaf_adsetadset✓
Adaf_adad✓
Channelaf_channelchannel✓
Publisher IDaf_siteidpublisher_id_af_siteid✓✓
Keywordsaf_keywordskeywords
Is Primary Attributionis_primaryis_primary_attribution
Campaign IDaf_c_idcampaign_id
Adset IDaf_adset_idadset_id
Ad IDaf_ad_idad_id
Install Timeinstall_timeinstall_time✓✓
Touch Typeattributed_touch_typetouch_type✓
GEOgeogeo✓✓
  • Metric fields

The following lists some commonly used fields of Master API. For the full list of fields, see the AppsFlyer documentation:

tip

New metric fields are added to Excluding Cohort KPIs data. To add metrics, specify them in the data integration configuration template

Ingested nameDescriptionExcluding Cohort KPIs dataIncluding Cohort KPIs data
impressionsImpressions✓✓
clicksClicks✓✓
installsInstalls✓✓
crConversion rate✓✓
sessionsSessions✓✓
loyal_usersLoyal user installs✓✓
loyal_users_rateLoyal user rate✓✓
costTotal cost✓✓
revenueTotal revenue✓✓
roiROI✓✓
arpu_ltvAverage lifetime value✓✓
average_ecpiAverage eCPI✓✓
uninstallsUninstalls✓✓
uninstalls_rateUninstall rate✓✓

retention_day_[x]

Retained users on day N (N = 0,1,2,3,4,5,6,7,15,30)✓
retention_rate_day_[x]Retention rate on day N (N = 0,1,2,3,4,5,6,7,15,30)✓

cohort_day_[x]_total_revenue_per_user

Cumulative revenue on day N (N = 1,2,3,4,5,6,7,15,30,40,50,60,70,80,90)✓

cohort_day_[x]_revenue_per_user

Same-day revenue on day N (N = 1,2,3,4,5,6,7,15,30,40,50,60,70,80,90)✓
cohort_[x]_days_total_revenue_per_userSame as cumulative revenue on day N (N = 1,2,3,4,5,6,7,15,30,40,50,60,70,80,90)✓

5.3 API parameters​

  • Time:

    • Data is pulled by day
    • The default time zone of the data is UTC

5.4 Data ingestion rules​

By default, we write the pulled data to the AE project as events:

  • Because the Master API aggregated metrics API returns aggregated data, we use a fixed value as the user identifier. You can think of all the data as attached to one virtual user

  • The install_time field in the data, that is, the user's install time, is used as the event's #event_time

  • The event names in the data are:

    • Including Cohort KPIs data
      • appsflyer_master_ltv_act_cohort_kpis
    • Excluding Cohort KPIs data
      • appsflyer_master_ltv_act_retention_kpis
  • All other fields are ingested

5.5 Data integration configuration template​

After reading the documentation above, we recommend that you fill in the following template and send it to your customer success manager at ThinkingAI:

Data pull interface: AppsFlyer Master API aggregated data API
--------
Company name: XXX
AE project environment: (SAAS/on-premises)
AE project name: XXX
AE project APP ID: XXX
Data receiving URL push_url: XXX
---------
AppsFlyer API Token: xxxxxxxx
AppsFlyer App ID: xxxxxxxx
---------
Data pull time zone: XXX (UTC by default)
New metrics: XXX, XXX (for event-related activity metrics, you can specify the names of the events whose metric data to pull; new metrics are added to the Excluding Cohort KPIs data, that is, the appsflyer_master_ltv_act_retention_kpis event)

Time range for historical data pull: yyyy/mm/dd - yyyy/mm/dd
Scheduled pull: pull the previous day's data at X:00 every day

6. Cohort API​

Basic interface information

InterfaceAPI typeProductizedData granularityAttributionCostRevenueImpressionsClicksConversions
Cohort APIPullNoAggregated dataYesYesYes

The Cohort API is also an aggregated data API. Compared with other aggregated data APIs, its metrics are closer to the results of the Cohort Dashboard in AppsFlyer and the Retention Analysis model in the AE system, that is, day N (or cumulative day N) metrics.

6.1 Before you begin​

6.1.1 Get the API Token​

Log in with an admin account, find API Access in the AppsFlyer sidebar menu, and get the V2.0 API token for Cohort API.

6.1.2 Get the App ID​

You can find your app's App ID under My Apps in the AppsFlyer dashboard. On Android, it starts with com., such as com.demoapp.ta; on iOS, it starts with id, such as id12345678

6.2 Included fields​

  • Analysis dimensions

Note that the Cohort API supports up to 7 analysis dimensions. The following are the default analysis dimensions. To change them, specify the changes in the data integration configuration template:

Field nameIngested nameDefault
Adaf_ad✓
Ad IDaf_ad_id
Campaignc✓
Campaign IDaf_c_id
Channelaf_channel✓
Media Sourcepid✓
Sub Param 1af_sub1
Keywordsaf_keywords
Agencyaf_prt
Conversion Type (1)cohort_type
Site IDsite_id
Attributed Touch Type (3)attributed_touch_type
Adsetaf_adset✓
Adset IDaf_adset_id
Countrygeo
Datedate✓
warning

Note that if you need to pull Facebook (Meta) data, do not select both af_channel and geo as analysis dimensions. Otherwise, Facebook cost data cannot be obtained

  • Metric fields

Note that the Cohort API returns 3 types of default metrics and one additional metric. The following are the default metric fields. To change them, specify the changes in the data integration configuration template:

Metric typeIngested nameDescriptionDefault
users (always returned)usersTotal users in the cohort (independent of the time window)✓
ecpi (always returned)ecpiTotal eCPI of the cohort (independent of the time window)✓
cost (always returned)costTotal cost of the cohort (independent of the time window)✓

"event_name" (custom event)

"event_name"_unique_users_day_NUsers who triggered the custom event on day N
"event_name"_count_day_NCompletions of the custom event on day N
"event_name"_rate_day_NCompletion rate of the custom event on day N
"event_name"_sum_day_NRevenue generated by the custom event on day N

revenue

revenue_count_day_NRevenue events triggered on day N✓
revenue_sum_day_NRevenue on day N✓
ROASroas_rate_day_NROAS on day N
roiroi_rate_day_NROI on day N

sessions

sessions_unique_users_day_NUsers who triggered a session on day N (not returned for cumulative metrics)
sessions_count_day_NSessions on day N
sessions_rate_day_NRetention rate on day N (users who triggered a session / total users in the cohort)
uninstallsuninstalls_count_day_NUninstalls on day N
uninstalls_rate_day_NUninstall rate on day N

Note: In the table above, N in the ingested name column represents the day-N metric. The default value range is 0-30

6.3 API parameters​

  • Time:

    • Data is pulled by day
    • The default time zone of the data is UTC
    • You can choose whether the data is independent for each day (that is, it shows the metrics of that day) or cumulative (that is, accumulated from day 0 to day N)
    • You can choose whether to allow data for incomplete days (for example, when the calculated day N is today) to be sent back

6.4 Data ingestion rules​

By default, we write the pulled data to the AE project as events:

  • Because the Cohort API aggregated metrics API returns aggregated data, we use a fixed value as its user identifier. You can think of all the data as attached to one virtual user
  • The date field in the data, that is, the user's attribution/conversion time, is used as the event's #event_time
  • The event name is appsflyer_cohort_api
  • All other fields are ingested

6.5 Data integration configuration template​

After reading the documentation above, we recommend that you fill in the following template and send it to your customer success manager at ThinkingAI:

Data pull interface: AppsFlyer Cohort API aggregated data API
--------
Company name: XXX
AE project environment: (SAAS/on-premises)
AE project name: XXX
AE project APP ID: XXX
Data receiving URL push_url: XXX
---------
AppsFlyer API Token: xxxxxxxx
AppsFlyer App ID: xxxxxxxx
---------
Data pull time zone: XXX (UTC by default)
Allow data for incomplete days: Yes/No (default: "Yes")
Time aggregation type of the data: Same day/Cumulative (default: cumulative)

Group-by dimensions: XXX, XXX (default: date,pid,geo,c,af_adset,af_ad,af_channel)
Metric field: XXX (default: revenue; only one can be set)

Time range for historical data pull: yyyy/mm/dd - yyyy/mm/dd
Scheduled pull: pull the data of the previous N days at X:00 every day

7. Data Locker and Cost ETL​

Data Locker is AppsFlyer's data export service. It can export multiple types of data to AWS or GCS cloud storage.

Cost ETL is AppsFlyer's cost data export service. It can export campaign cost data from each media source to AWS or GCS cloud storage.

The AE system currently supports integrating data from AWS S3 and GCS. Depending on the type of cloud storage you export to, see the following documents:

8. Integration testing and data usage after integration​

1. Integration testing​

1.1 Push API

You can view the related attribution data on the Management > User properties page. If the related user properties exist, the integration is successful.

AppsFlyer callback fieldUser property name in AEData type
media_source#appsflyer_media_sourceText
campaign#appsflyer_campaignText
af_adset#appsflyer_adsetText
af_ad#appsflyer_adText

If you have enabled event table ingestion, view the related event data on the Management > Events page. The event names are the same as those defined in AppsFlyer.

1.2 Pull API and Master API aggregated data APIs

You can view the related events on the Management > Events page. If the related events exist, the integration is successful.

InterfaceReport nameEvent name in AEData type
Pull APIDelivery report for all media sources - dailyappsflyer_partner_by_dateText
Pull APIFacebook delivery report - dailyappsflyer_facebook_partner_by_dateText
Master APILTV, Activity, and Retention KPIsappsflyer_master_ltv_act_retention_kpisText
Master APILTV, Activity, and Retention plus Cohort KPIsappsflyer_master_ltv_act_retention_cohort_kpisText

2. Data usage​

2.1 Analysis based on attribution information

2.2 Compare installs, cost, revenue, and ROAS across media by channel, ad group, campaign, and ad creative

2.3 View marketing data and user behavior data on one platform, with less switching between platforms

2.4 Linked data analysis, such as connecting with monetization data and data from other media sources

2.5 Calculate the ROAS of different media sources through revenue / cost

2.6 Analyze the quality of non-organic users through their key behaviors (such as an event before payment, like retention in a core gameplay feature), shortening the time from analysis to decision

2.7 Data types of event properties after integration

For data pulled through the AppsFlyer Pull API, event properties are ingested as strings by default. You can use the custom property feature of the AE system to convert string fields to other types, for example:

  • Convert the install property to a numeric type: "af_install_number" (select numeric as the data type)
  • Convert the total_cost property to a numeric type: "af_total_cost_number" (select numeric as the data type)

9. FAQ​

See the AppsFlyer FAQ

Was this page helpful?