Why use AppsFlyer?
- Attribution and ROI: Attribute installs to campaigns and measure return on ad spend.
- Automatic event tracking: Installs, updates, and sessions are recorded without extra code.
- Custom in-app events: Log business events (e.g. signup, purchase) via the JavaScript Bridge.
- Conversion and deep link data: Receive install attribution and deep link payloads in your web app via callbacks.
af_status: A string in the conversion data object indicating whether the install is Organic or Non-organic. Use it to branch logic (e.g. show different onboarding for paid vs organic users).
Organic vs non-organic: Organic = install not attributed to a campaign; non-organic = attributed to a marketing source.
Prerequisites
- A Median app with JavaScript Bridge enabled
- An AppsFlyer account and app(s) created for iOS and Android
- Apple App ID (from App Store Connect – App Information) or your app’s App Store URL
- Android package name (from Median App Identifiers) or your app’s Play Store URL
- For iOS 14.5+: ATT implemented and, if desired, ATT prompt delay configured in the plugin
Developer DemoDisplay our demo page in your app to test during development https://median.dev/appsflyer/
When to use this plugin
AppsFlyer is essential for apps that need to:Implementation guide
AppsFlyer configuration
Before enabling the plugin in Median, create and configure your app in the AppsFlyer dashboard using your Apple App ID and Android package name (see Prerequisites). Add one app for iOS and one for Android; once each is created, you’ll receive a dev key for that platform.
AppsFlyer: dev key
App Studio configuration
Enable the plugin
- Open Native Plugins: In Median App Studio, open your app and go to Native Plugins.
- Open AppsFlyer: Select AppsFlyer and go to Settings.
- Enter credentials: Set Android Dev Key, Apple Dev Key, and Apple App ID from your AppsFlyer setup. Optionally set the ATT prompt delay (iOS).
Configuration options

Median AppsFlyer plugin configuration
NoteThe configuration above is a sample for the developer demo. AppsFlyer is highly customizable. For production, we recommend consulting AppsFlyer or your marketing team to tailor settings (attribution, uninstall measurement, etc.) to your needs. See the AppsFlyer Help Center.
JavaScript Bridge functions
Associate a user
Associates your own customer user ID with AppsFlyer so you can cross-reference it with AppsFlyer’s device IDs and your backend.Log a custom in-app event
Logs a custom in-app event with an optional object of values. Use it for signups, purchases, or any business event you want to measure in AppsFlyer.Read cached conversion or deep link data
Both values are cached natively once the AppsFlyer SDK returns them. These functions read that cache and return immediately. They never wait for the SDK, so on a cold launch they can resolve withdata: null before the value has arrived. Use the callbacks below to be told the moment it does.
median-js-bridge NPM package.
Conversion data and deep link callbacks
The app invokes global callback functions you define when conversion or deep link data is available (on app launch or when brought to the foreground, e.g. via a deep link). Data is cached after the first call and will be the same on later invocations. To read a cached value at any time instead of waiting for a callback, see Read cached conversion or deep link data. Legacy conversion (install) data Define this function so the app can pass conversion data for the install:deeplinkValue, campaign, mediaSource):
median-js-bridge package. Each listener returns an ID you can use to remove it later.
Conversion data
data with success at the root, matching what getDeepLinkResult() returns:
deeplinkValue defensively rather than branching on the shape.
Testing checklist
Use this checklist to confirm AppsFlyer is working in your app:Basic functionality
- Plugin is enabled and configured in Native Plugins > AppsFlyer > Settings
-
median.appsflyer.setCustomerUserId(id)runs without errors -
median.appsflyer.logEvent(name, values)runs without errors - Conversion callback (
median_appsflyer_cd_successormedian_appsflyer_cd) is called on launch or when returning to the app
Platform testing
- Behavior verified on a real Android device (not only simulator)
- Behavior verified on a real iOS device (not only simulator)
- On iOS 14.5+, ATT prompt appears when configured and consent affects behavior as expected
Configuration testing
- Android Dev Key, Apple Dev Key, and Apple App ID match the AppsFlyer dashboard
- Global callback function names match exactly (
median_appsflyer_cd_success,median_appsflyer_cd,median_appsflyer_deeplink_result)
User experience
- No JavaScript errors in the console from the plugin or callbacks
- Callbacks do not block the UI; navigation or UI updates remain responsive
Troubleshooting
AppsFlyer functions are undefined or not working
Ensure the JavaScript Bridge is enabled in your Median app and that you are callingmedian.appsflyer after the app and bridge are ready (e.g. after median_library_ready() or when your main app script runs). Confirm the AppsFlyer plugin is enabled under Native Plugins in App Studio.
Conversion callback is never called
Conversion data is provided when the app is launched or brought to the foreground. Ensure you define the global function names exactly:median_appsflyer_cd_success (legacy), median_appsflyer_cd (new), or median_appsflyer_deeplink_result (UDL). The SDK may take a moment to return data; avoid removing or redefining these callbacks during the first launch.
ATT prompt does not appear on iOS
Confirm App Tracking Transparency is implemented in your app and that you have configured the ATT prompt (and optional delay) as required. The simulator may not show the system ATT dialog; test on a real device.Events or installs do not show in the AppsFlyer dashboard
Verify Android Dev Key, Apple Dev Key, and Apple App ID in Native Plugins > AppsFlyer > Settings match the app in your AppsFlyer dashboard. Ensure you are testing on a real device; the SDK does not fully work in the simulator. Allow some time for data to appear in the dashboard.Wrong or missing conversion data
Conversion data is cached after the first callback. For a fresh install, the first launch may have limited data until attribution is resolved. Check AppsFlyer’s documentation on timing and testing.Deep link callback not firing
Confirm your deep link URL scheme and link format are configured correctly in AppsFlyer and that the app is opened via that link (not only from the home screen). Use AppsFlyer’s deep link validator and test on a real device.Still having trouble?For SDK-level errors or attribution behavior, refer to the AppsFlyer SDK documentation.