AppsFlyer
Overview
Median's AppsFlyer Native Plugin provides app installation and event recording functionality. You can record app installs, updates, sessions, and in-app events, which can help you evaluate ROI and user quality.
All default events will be recorded automatically. Custom in-app events can be sent using the Median JavaScript Bridge.
Implementation Guide
Developer Demo
Display our demo page in your app to test during development https://median.dev/appsflyer/
iOS 14.5+ App Tracking Transparency Requirement
Requesting user consent through the App Tracking Transparency (ATT) framework is required for iOS 14.5+. Learn more about adding ATT support for your iOS app in our docs and additionally refer to the AppsFlyer documentation.
AppsFlyer and App Configuration
AppsFlyer Configuration
Configuration Disclaimer
Please be aware that the following steps provide a sample implementation to demonstrate the configuration for the Developer Demo. AppsFlyer is a highly customizable and the configuration below may not be suitable for your production environment. We strongly recommend consulting with AppsFlyer experts to review and tailor your production configuration to your needs.
Additional information on the AppsFlyer configuration can be found here: AppsFlyer Help Center
You will need to set up dedicated apps for iOS and Android in your AppsFlyer dashboard. In order to set up the apps, you will need your Android Package Name as well as your Apple App ID. For our demo app, we will use the values below. Should your app already be available in the Apple App Store or Google Play store you can use the app store URLs instead.
Key | Example Value | Source |
---|---|---|
Apple App Id | 123456789 | App Store Connect (App Information) |
Android Package Name | co.median.android.dnxqyl | Median App Studio (App Identifiers) |
Once the app is successfully created and added to your Dashboard, you will receive a dev key as shown below.
Please note that you may need to perform additional configuration steps within the AppsFlyer App Settings to configure tracking events such as Re-engagement attribution, Uninstall measurements or others. You can learn more about AppsFlyer App Settings in the AppsFlyer App Serttings Documentation.
Median App Configuration
The AppsFlyer Native Plugin requires several parameters to be set in the App Studio, on the Native Plugins tab under "Settings". You will need to use the following parameters as previously created during the AppsFlyer Setup: Android Dev Key
, Apple Dev Key
, Apple App ID
and optionally a delay for the ATT prompt.
Implementation Guide
Associating a User
Setting your own customer ID enables you to cross-reference your own unique ID with AppsFlyer’s unique ID and other devices’ IDs.
↔️Median JavaScript Bridge
median.appsflyer.setCustomerUserId(STRING id);
Log a Custom In-App Event
↔️Median JavaScript Bridge
median.appsflyer.logEvent(STRING eventName, OBJECT eventValues); // eventValues is a JavaScript object
Conversion Data
Define a callback which will be invoked by the app with AppsFlyer conversion data each time the app is launched or brought to the foreground (e.g. via a deep link). The function is called with an object (conversionDataMap
in the below example) that contains the conversion data provided by the AppsFlyer SDK for that install including the property af_status
which specifies the install as Organic or Non-organic. The conversion data is cached the first time the callback is called and will be identical on consecutive calls.
↔️Median JavaScript Bridge
// Define this function which will be called automatically by the app function median_appsflyer_cd_success(conversionDataMap){ // conversionDataMap.af_status is a String set as "Organic" or "Non-organic" }
Testing the AppsFlyer Integration
AppsFlyer Integration Tests
AppsFlyer offers a built-in test suite for integration testing AppsFlyer - Testing the SDK integration as well as instructions to registering test devices. The SDK integration can not be tested in the simulator.
Updated 21 days ago