Skip to main content

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

note

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.

Image: Register for an account

2. Create an app

To add a new app, see Adding an app to AppsFlyer.

Image: Create an app

3. Obtain app configuration information
  1. Go to AppsFlyer.

  2. View the iOS App ID.
    The iOS App ID is the number following the word id.

    Image: AppID information

  3. In the navigation bar on the left, select Configuration > App Settings.

  4. View SDK Dev Key for iOS and Android.
    The SDK Dev Key is the App Key.

    Image: AppKey information

  1. Integrate the Player Network SDK.

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
info

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:

  1. 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.

    Image: SenderID

  2. 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.

note

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 time
  • af_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

note

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

Initialize the Analytics module, then call ReportEvent to start AppsFlyer data reporting.

Data reporting acceptance

References

  1. AppsFlyer login page
  2. Android SDK guide / iOS SDK guide
  3. Android SDK reference / iOS SDK reference
  4. 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

caution

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:

After a successful registration, view the added test devices on the console.

Image: Registered device

For more information, see Registering test devices.

2. Test events
  1. Install the app on a registered test device to test and track events.

    Image: Test install event

  2. After a successful installation, go back to the AppsFlyer console, which will prompt that it tracked an install event.

    Image: Successfully tracked install event

  3. Click In-app Events and click ReportEvent on the test device.

    Image: Test app event

  4. Go back to the AppsFlyer console, which will display the tracked app event.

    Image: Successfully tracked install event

3. Export data

Images

  • 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.

Images

  • 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.

Images

  • Select channel
  • View app installs
6. Verify test data
  • Overall data preview

    Image: Overall data preview

  • Event data report

    Image: Event data report

  • Data export

    Image: 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
    1. Log in as a guest for the first time
    2. Log off
    3. Log in again with the same account
    4. Export data and view reported events on the console
  • Expected output: Information reported successfully.
    1. On the console, view:
      1. Registration event reported for first guest login (af_complete_registration): Reported qty+1
      2. Login event reported when user logs in again with the same account (af_login): Reported qty+1
    2. Export data verification:
      1. Registration event reported for first guest login (af_complete_registration): Reported qty+1
      2. Login event reported when user logs in again with the same account (af_login): Reported qty+1
      3. Player Network SDK OpenID is provided in the event parameters

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
    1. Use Facebook to log in for the first time
    2. Log off
    3. Log in again with the same account
    4. On the console, export data and view reported events
  • Expected output: Information reported successfully.
    1. On the console, view:
      1. Registration event reported for first guest login (af_complete_registration): Reported qty+1
      2. Login event reported when user logs in again with the same account (af_login): Reported qty+1
    2. Exported data verification: Contact [killuachen] to form a group for final confirmation.
      1. Registration event reported for first guest login (af_complete_registration): Reported qty+1
      2. Login event reported when user logs in again with the same account (af_login): Reported qty+1
      3. Customer User ID and Player Network SDK OpenID are consistent

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
    1. Request Report Event
    2. eventName = Report_Event, paramsDic-key1=k1, paramsDic-value1=v1, paramsDic-key2=k2, paramsDic-value2=v2, spChannels = AppsFlyer
    3. Install/Uninstall SDK and launch game
    4. Filter condition: appsflyer_sdk_test_int
    5. View report data and export the INSTALL data table
  • Expected output: Information reported successfully.
    1. On the console, view:
      1. 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.)
      2. Install event: View reported install events add 1
    2. Export data verification:
      1. Custom events:
        • app-event data table: Provides data of Install Time, Event Time, Event Name, and Event Value
        • app-event data table:
      2. Install event:
        • INSTALL data table: Provides data of Install Time, Event Time, and Event Name
        • INSTALL data table reported qty+1

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
    1. Request Report_Event
    2. eventName = Report_Event, paramsDic-key1=k1, paramsDic-value1=v1, paramsDic-key2=k2, paramsDic-value2=v2, spChannels = AppsFlyer
    3. Install/Uninstall SDK and launch game
    4. Filter condition: appsflyer_sdk_test_int
    5. View report data and export the INSTALL data table
  • Expected output: Information reported successfully.
    1. On the console, AppsFlyer can:
      1. 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).
      2. Install event: View reported install events and +1
    2. Export data verification:
      1. Custom events:
        • app-event data table: Provides data of Install Time, Event Time, Event Name, and Event Value
        • app-event data table:
      2. Install event:
        • INSTALL data table: Provides data of Install Time, Event Time, and Event Name
        • INSTALL data table reported qty+1

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
    1. Request ReportRevenue
    2. eventName = (customizable), spChannels = AppsFlyer, Currency = USD, Revenue = 100
    3. AppsFlyer query and report events
    4. DD Platform query AnalyticsReportRevenue event
  • Expected output: Information reported successfully.
    1. 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
    2. 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
    3. DD Platform successfully queries the event reporting with methodName as AnalyticsReportRevenue and method_id=715.

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
    1. Request ReportRevenue
    2. eventName = (customizable), spChannels = AppsFlyer, Currency = USD, Revenue = 1000
    3. Reconnect to the network
    4. AppsFlyer query and report events
    5. DD Platform query AnalyticsReportRevenue event
  • Expected output: Information reported successfully Check the following:
    1. After reconnecting to the network
    2. 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
    3. 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
    4. The DD Platform successfully queries the event reporting with methodName as AnalyticsReportRevenue and method_id=715.

Functions

Uninstall/install

For Android integration:

info

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

string extraJson =  "{\"timeoutInterval\": \"60\"}";
INTLAPI.ExtendInvoke("AppsFlyer", "waitForATTUserAuthorizationWithTimeoutInterval", extraJson);

The listening duration parameter timeoutInterval (in seconds) is passed in extraJson.

info

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.

caution

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
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 in https://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.