AppsFlyer

Learn how to set up integration with AppsFlyer

To integrate AppsFlyer go to Integrations > AppsFlyer and set credentials.

To find App ID, open your app page in App Store Connect, go to the App Information page in section General and find Apple ID in the left bottom part of the screen.

To find Android Package Name, open your app page on Google Play Console. You can see it under the app name.

Open AppsFlyer and navigate to your app page. Scroll the left menu bar, find App Settings, and use Dev Key.

Finding Dev Key in AppsFlyerFinding Dev Key in AppsFlyer

📘

AppsFlyer doesn't have a Sandbox mode for server2server integration. So you need a different application/account in AppsFlyer for Sandbox Dev Key. If you want to send sandbox events to the same app, just use the same key for production and sandbox.

Adapty maps some events to AppsFlyer standard events by default. With such configuration, AppsFlyer can further send events to each ad network that you use without additional setup.

SDK configuration

It's very important to send AppsFlyer attribution data from the device to Adapty using Adapty.updateAttribution() SDK method. The example below shows how to do that.

extension AppDelegate: AppsFlyerLibDelegate {
    func onConversionDataSuccess(_ installData: [AnyHashable : Any]) {
        // It's important to include the network user ID
        Adapty.updateAttribution(installData, source: .appsflyer, networkUserId: AppsFlyerLib.shared().getAppsFlyerUID())
    }
}
val conversionListener: AppsFlyerConversionListener = object : AppsFlyerConversionListener {
    override fun onConversionDataSuccess(conversionData: Map<String, Any>) {
        // It's important to include the network user ID
        Adapty.updateAttribution(
            conversionData,
            AttributionType.APPSFLYER,
            AppsFlyerLib.getInstance().getAppsFlyerUID(context)
        )
    }
}
@override
Future<bool> initialize() async {
    appsflyerSdk.onInstallConversionData((data) {
        await Adapty.updateAttribution(data, source: AdaptyAttributionNetwork.appsflyer, networkUserId: await appsflyerSdk.getAppsFlyerUID());
    });

    await appsflyerSdk.initSdk(
    registerConversionDataCallback: true,
    registerOnAppOpenAttributionCallback: true,
    registerOnDeepLinkingCallback: true
    );

    return Future<bool>.value(true);
}

Did this page help you?