Set up AppsFlyer as an analytics platform
This article guides you on setting up AppsFlyer as an analytics platform, allowing your game to report telemetry data directly to AppsFlyer.
Prerequisites
AppsFlyer supports multi-store packages through multiple app IDs under the same developer account. Create additional game apps on AppsFlyer and complete the configurations for additional game apps by following the steps.
1. Register for an account
AppsFlyer is a paid platform, games need to apply for an account and configure basic information.
2. Create an app
To add a new app, see Adding an app to AppsFlyer.
3. Obtain app configuration information
Go to AppsFlyer.
View the iOS App ID.
The iOS App ID is the number following the word id.In the navigation bar on the left, select Configuration > App Settings.
View SDK Dev Key for iOS and Android.
The SDK Dev Key is the App Key.
Step 1: Set up permissions and configurations
Android
User Permissions
Required permissions are configured for Player Network SDK and games can check the configurations in the exported APK package.
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Optional permissions are sensitive permissions used to obtain and track Android hardware device information and is not recommended to use. If required, add the configurations to the AndroidManifest.xml
file.
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
For AppsFlyer, WiFi status permission is not requested by default and this permission is optional. Adjust may use this permission to collect Mac addresses after merging AndroidManifest.xml
, and hence this permission is not requested by default.
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
For AppsFlyer, WAKE_LOCK
permission is not requested by default.
<uses-permission android:name="android.permission.WAKE_LOCK" />
AD_ID collection will be enabled by default, if the business needs to revoke the permission, you can add it to the AndroidManifest.xml
file by yourself.
<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove" />
Configurations
For more information, see Android SDK integration for developers.
Add the following configurations in the INTLConfig.ini file:
[AppsFlyer Debug Mode]
DEBUG_CHANNEL = AppsFlyer
[Android LifeCycle]
LIFECYCLE = AppsFlyer
[AppsFlyer Configuration]
APPSFLYER_APP_KEY_ANDROID={YOUR_APPSFLYER_KEY}
- Replace
{YOUR_APPSFLYER_KEY}
with the App Key found on the AppsFlyer Dashboard. - Add AppsFlyer to
LIFECYCLE
. For more information, see SDK environment. - Replace
{DEBUG_CHANNEL}
with AppsFlyer to enable AppsFlyer debug mode.
[Optional] Track uninstallation information
Depends on the Google push service:
On the Firebase console, add FCM Sender ID.
Add the following configuration in the INTLConfig.ini file.
[AppsFlyer Configuration]
FIREBASE_SENDER_ID={YOUR_FIREBASE_SENDER_ID}Replace
{YOUR_FIREBASE_SENDER_ID}
with the Firebase Sender ID of the game.Get the push Token and call the AppsFlyer API.
For more information, see Uninstall measurement.
[Optional] Get IMEI ANDROID_ID
As READ_PHONE_STATE
permission is required to get IMEI, AppsFlyer does not get IMEI by default. However, if it is required, add the configuration in INTLConfig.ini.
[AppsFlyer Configuration]
APPSFLYER_APP_IMEI_ENABLE=1
[Optional] Get ANDROID_ID
As ANDROID_ID is essential for reporting, and READ_PHONE_STATE
permission is not required to get ANDROID_ID, AppsFlyer will get ANDROID_ID by default. However, if it is not required, update the configuration in INTLConfig.ini.
[AppsFlyer Configuration]
APPSFLYER_APP_ANDROID_ID_ENABLE=0
iOS
Configurations
Add the following configurations in the INTLConfig.ini file:
[AppsFlyer Debug Mode]
DEBUG_CHANNEL = AppsFlyer
[AppsFlyer Configurations]
APPSFLYER_APP_ID_IOS = {YOUR_APPSFLYER_APPID}
APPSFLYER_APP_KEY_IOS = {YOUR_APPSFLYER_KEY}
- Replace
{DEBUG_CHANNEL}
with AppsFlyer to enable AppsFlyer debug mode. - Replace
{YOUR_APPSFLYER_APPID}
with the App ID found on the AppsFlyer dashboard. - Replace
{YOUR_APPSFLYER_KEY}
with the App Key found on the AppsFlyer dashboard.
[Optional] Export Xcode with Unity
When using Unity to export Xcode projects, configure the .projmods file.
Games need to check the configurations written in INTLCoreKit.projmods
.
{
"group": "INTL",
"libs": [],
"frameworks": ["AdSupport.framework", "iAd.framework"],
"files": [],
"folders": [],
"excludes": [],
"headerpaths":[],
"build_settings":{},
"system_capabilities": {},
"Info.plist":{}
}
[Optional] Strict-mode SDK
Use the strict mode SDK to remove IDFA collection functionality and AdSupport framework dependencies completely. Its default value is true. For more information, see Strict-mode SDK.
Add the following configuration in the INTLConfig.ini file.
[AppsFlyer Configuration]
APPSFLYER_ADSUPPORT_AND_IAD_ENABLE = 0
[Optional] Anonymize user data
Player Network SDK provides a way to enable or disable AppsFlyer to anonymize specific user identifiers. Its default value is false. For more information, see Anonymize user data.
Add the following configuration in the INTLConfig.ini file.
[AppsFlyer Configuration]
APPSFLYER_ANONYMIZE_USER_ENABLE = 1
[Optional] Deep Linking
To support deep link reporting, the app must first support Universal Links. For more information, see OneLink links and experiences.
Step 2: Configure event reporting
Automatically logged events
If ANALYTICS_AUTH_REPORT_ENABLE
is enabled in the INTLConfig.ini file, Player Network SDK will automatically report the following events:
af_complete_registration
: When a user logs in to the game for the first timeaf_login
: When a user logs in to the game subsequently
Manually logged events
For more information on data reporting, see Event Reporting Module.
AppsFlyer recommends using only lowercase English letters (a-z) and numbers (0-9) to name in-app events (EventName), see In-app events for more details.
Funnel events
Supported since Player Network SDK V1.20.
Add the AppsFlyer channel to the ANALYTICS_REPORT_FUNNEL_CHANNEL
configuration in INTLConfig.ini, and Player Network SDK will synchronize the funnel events to the AppsFlyer channel.
[ANALYTICS]
ANALYTICS_REPORT_FUNNEL_CHANNEL = AppsFlyer
See View reported events in the console to view the reported events.
Step 3: Initialize Analytics
- Unity
- Unreal Engine
Initialize the Analytics module, then call ReportEvent
to start AppsFlyer data reporting.
Initialize the Analytics module, then call ReportEvent
to start AppsFlyer data reporting.
Data reporting acceptance
References
- AppsFlyer login page
- Android SDK guide / iOS SDK guide
- Android SDK reference / iOS SDK reference
- Data Export Address
Data dimensions
AppsFlyer events:
- Install event: Add an allowlist for verification.
- Organic install: AppsFlyer excludes install events outside the integrated channels.
- Non-organic install: AppsFlyer can monitor install events of the downloaded channels.
- InAppEvent: The console uses EventName to distinguish events.
View reported events in the console
Events are not reported in realtime, with a latency of about 10 minutes.
1. Register test device
Register test devices to prevent install events or app events on test devices from having duplicate install records on AppsFlyer.
AppsFlyer provides the following two methods:
Download the My Device ID by AppsFlyer app and register the test devices in the app.
Manually register test devices in AppsFlyer.
After a successful registration, view the added test devices on the console.
For more information, see Registering test devices.
2. Test events
Install the app on a registered test device to test and track events.
After a successful installation, go back to the AppsFlyer console, which will prompt that it tracked an install event.
Click In-app Events and click ReportEvent on the test device.
Go back to the AppsFlyer console, which will display the tracked app event.
3. Export data
- Export data
- Select event type: Activation/In-app events
- Select the time range
- Export event data
4. View InAppEvents
On the AppsFlyer left side menu, select Control Panel > Event Reports to view in-app events.
- Non-organic events
- Organic events
5. View InstallEvents
On the AppsFlyer left side menu, select Control Panel > Data Overview > Media Channels to view the number of app installs. View the number of organic and non-organic installs by channel.
- Select channel
- View app installs
6. Verify test data
Overall data preview
Event data report
Data export
Acceptance use case 1
- Sub-function module: Reporting
- Feature: Event Reporting
- Test points: First and subsequent login to the game, check AppsFlyer login reporting
- Prerequisites: Initialize Analytics module
- Procedure/Input
- Log in as a guest for the first time
- Log off
- Log in again with the same account
- Export data and view reported events on the console
- Expected output: Information reported successfully.
- On the console, view:
- Registration event reported for first guest login (af_complete_registration): Reported qty+1
- Login event reported when user logs in again with the same account (af_login): Reported qty+1
- Export data verification:
- Registration event reported for first guest login (af_complete_registration): Reported qty+1
- Login event reported when user logs in again with the same account (af_login): Reported qty+1
- Player Network SDK OpenID is provided in the event parameters
- On the console, view:
Acceptance use case 2
- Sub-function module: Reporting
- Feature: Event Reporting
- Test points: Non-first login from Facebook, check AppsFlyer login reporting
- Prerequisites: Initialize Analytics module
- Procedure/Input
- Use Facebook to log in for the first time
- Log off
- Log in again with the same account
- On the console, export data and view reported events
- Expected output: Information reported successfully.
- On the console, view:
- Registration event reported for first guest login (af_complete_registration): Reported qty+1
- Login event reported when user logs in again with the same account (af_login): Reported qty+1
- Exported data verification: Contact [killuachen] to form a group for final confirmation.
- Registration event reported for first guest login (af_complete_registration): Reported qty+1
- Login event reported when user logs in again with the same account (af_login): Reported qty+1
- Customer User ID and Player Network SDK OpenID are consistent
- On the console, view:
Acceptance use case 3
- Sub-function module: Reporting
- Feature: Event Reporting
- Test points: Old device, event information successfully reported by AppsFlyer
- Prerequisites: Add the old device with the app to the AppsFlyer console, second time reporting
- Procedure/Input
- Request Report Event
- eventName =
Report_Event
, paramsDic-key1
=k1
, paramsDic-value1
=v1
, paramsDic-key2
=k2
, paramsDic-value2
=v2
, spChannels =AppsFlyer
- Install/Uninstall SDK and launch game
- Filter condition:
appsflyer_sdk_test_int
- View report data and export the INSTALL data table
- Expected output: Information reported successfully.
- On the console, view:
- Custom events: AppsFlyer can query custom
Report_Event
qty add 1. The unique user value does not increase. (You can only view one detailed data for the current report.) - Install event: View
reported install events
add 1
- Custom events: AppsFlyer can query custom
- Export data verification:
- Custom events:
- app-event data table: Provides data of Install Time, Event Time, Event Name, and Event Value
- app-event data table:
- Install event:
- INSTALL data table: Provides data of Install Time, Event Time, and Event Name
- INSTALL data table reported qty+1
- Custom events:
- On the console, view:
Acceptance use case 4
- Sub-function module: Reporting
- Feature: Event Reporting
- Test points: New device, event information successfully reported by AppsFlyer
- Prerequisites: Add the new device with the app to the AppsFlyer console, first time reporting
- Procedure/Input
- Request
Report_Event
- eventName =
Report_Event
, paramsDic-key1
=k1
, paramsDic-value1
=v1
, paramsDic-key2
=k2
, paramsDic-value2
=v2
, spChannels =AppsFlyer
- Install/Uninstall SDK and launch game
- Filter condition:
appsflyer_sdk_test_int
- View report data and export the INSTALL data table
- Request
- Expected output: Information reported successfully.
- On the console, AppsFlyer can:
- Query reported events, add 1 to the number of custom
Report_Events
, and add 1 to unique users (multiple reports also only requires add 1). - Install event: View reported install events and +1
- Query reported events, add 1 to the number of custom
- Export data verification:
- Custom events:
- app-event data table: Provides data of Install Time, Event Time, Event Name, and Event Value
- app-event data table:
- Install event:
- INSTALL data table: Provides data of Install Time, Event Time, and Event Name
- INSTALL data table reported qty+1
- Custom events:
- On the console, AppsFlyer can:
Acceptance use case 5
- Sub-function module: ReportRevenue
- Feature: AppsFlyer payment event reporting
- Test points: Query report after requesting
ReportRevenue
(AppsFlyer) - Prerequisite: Network connection is normal
- Procedure/Input
- Request
ReportRevenue
- eventName = (customizable), spChannels =
AppsFlyer
, Currency =USD
, Revenue = 100 - AppsFlyer query and report events
- DD Platform query
AnalyticsReportRevenue
event
- Request
- Expected output: Information reported successfully.
- On the console, view:
- Events view on the left side of AppsFlyer
- After connecting to the Internet, AppsFlyer related event statistics +1, click the event details display to display USD100 related values
- Export data verification (2-4 hours):
- Export data on the left side of AppsFlyer, select in-app events
- 2~4 hours delay in exporting data
- Export data contains income events, amount data
- DD Platform successfully queries the event reporting with
methodName
asAnalyticsReportRevenue
andmethod_id=715
.
- On the console, view:
Acceptance use case 6
- Sub-function module: ReportRevenue
- Feature: AppsFlyer payment event reporting
- Test points: Query report after requesting
ReportRevenue
in disconnected state (AppsFlyer) - Prerequisite: Disconnected network status
- Procedure/Input
- Request
ReportRevenue
- eventName = (customizable), spChannels =
AppsFlyer
, Currency =USD
, Revenue = 1000 - Reconnect to the network
- AppsFlyer query and report events
- DD Platform query
AnalyticsReportRevenue
event
- Request
- Expected output: Information reported successfully Check the following:
- After reconnecting to the network
- On the console, view:
- View Events on the left side of AppsFlyer
- After connecting to the Internet, AppsFlyer related event statistics +1, click on the event details display to display USD1000 related value
- Export data verification (2-4 hours):
- Export data on the left side of AppsFlyer, select in-app events
- 2~4 hours delay in exporting data
- Export data contains income events, amount data
- The DD Platform successfully queries the event reporting with
methodName
asAnalyticsReportRevenue
andmethod_id=715
.
Functions
Uninstall/install
For Android integration:
The AppsFlyer uninstall/install function depends on the FireBase push. Games need to obtain push tokens based on their push components.
To implement the AppsFlyer uninstall/install function, games need to call the SetPushToken
API extended by AppsFlyer:
YOUR_PUSH_TOKEN
is the FireBase push token obtained by the push component.
WaitForATTUserAuthorizationWithTimeoutInterval
- Unity
- Unreal Engine
string extraJson = "{\"timeoutInterval\": \"60\"}";
INTLAPI.ExtendInvoke("AppsFlyer", "waitForATTUserAuthorizationWithTimeoutInterval", extraJson);
FString extraJson = "{\"timeoutInterval\": \"60\"}";
UINTLSDKAPI::ExtendInvoke(EINTLLoginChannel::kChannelAppsFlyer, "waitForATTUserAuthorizationWithTimeoutInterval", extraJson);
The listening duration parameter timeoutInterval
(in seconds) is passed in extraJson
.
If the APPSFLYER_WAITFORATT_TIMEOUT parameter (units: seconds, must be a non-negative int value) is configured in INTLConfig.ini
, this API will be triggered upon app startup. If not, the API will not be triggered.
This API must be used with RequestTrackingAuthorization and authorization must be completed within the listening duration. This is used to get the IDFA in the data reported by IDFA.
FAQ
Event reporting restrictions
A single event for a single app on a single device will only be displayed once when the same event is reported at intervals of 10 seconds or less.
This restriction does not apply to single events from different devices, which are all recorded in realtime.
AppsFlyer sets this restriction based on statistical data because a normal user cannot report the same event multiple times within 10 seconds.
Organic/Non-organic installations
On the AppsFlyer control panel, both organic and non-organic data are recorded at the same time.
- Organic installs occur when users install the app through normal methods, such as direct installs, rather than by using the link in ads pushed by AppsFlyer.
The in-app events corresponding to organic installs are not displayed in the direct download in-app event report on the control panel. This is because in-app event downloads are in-app events corresponding to non-organic installs. - Non-organic installs occur when users install the app by using the link in ads pushed by AppsFlyer.
AppsFlyer official documentation
Integration Documentation
- For Android integration, see AppsFlyer Integration Webpage (Android).
- For iOS integration, see AppsFlyer Integration Webpage (iOS).
Pre-release Testing Documentation
- Before releasing an Android app in the Google Play Store, see Test mobile SDK integration with the app (Android) (pre-release).
- Before releasing an iOS app in the App Store, see Test mobile SDK integration with the app (iOS) (pre-release).
Post-release Testing Documentation
- After releasing an Android app in the Google Play Store, see Test mobile SDK integration with the app (Android) (post-release).
- After releasing an iOS app in the App Store, see Test mobile SDK integration with the app (iOS) (post-release).
Contact AppsFlyer
To contact AppsFlyer for troubleshooting, provide the following information:
- App ID
- Time period of interest
- Event ID
- Device IDFA
- Package name
Use ID field in the test URL, for example: id1089079153 inhttps://app.appsflyer.com/id1089079153?pid=locky0508-2&idfa=A56EC65B-DF48-42F4-B74C-DCE6B818E729
, not the bundleID or package name.
Android dependency on Google Services
To use AppsFlyer, Android devices must install Google services. Therefore, test AppsFlyer integration on devices installed with Google services.
AppsFlyer packaging
AppsFlyer no longer supports ANT packaging.