Appsflyer

This section describes how to integrate AppsFlyer with Purchasely

Integration

The integration of AppsFlyer requires 2 steps:

  1. Associate the user to events by providing the AppsFlyer ID to the Purchasely SDK
  2. Activate the AppsFlyer integration in the Purchasely Console

🚧

Version compatibility

The minimal version of the Purchasely SDK supporting this integration is v3.2.0.

If the Purchasely SDK integrated in your app is under the minimal version, please upgrade it.

The AppsFlyer SDK also needs to be integrated inside the app.

1. Associating users to events

See iOS or Android Appsflyer documentation for more information.

Purchasely.setAttribute(.appsflyerId, value: AppsFlyerLib.shared().getAppsFlyerUID())
AppsFlyerLib.getInstance().getAppsFlyerUID(applicationContext)?.let {
    Purchasely.setAttribute(Attribute.APPSFLYER_ID, it)
}

appsFlyer.getAppsFlyerUID((err, appsFlyerUID) => {
  if (err) {
    console.error(err);
  } else {
    Purchasely.setAttribute(Attributes.APPSFLYER_ID, appsFlyerUID);
  }
});

appsFlyerSdk.getAppsFlyerUID().then((AppsFlyerId) {
  Purchasely.setAttribute(PLYAttribute.appsflyer_id,AppsFlyerId);
});
var  getUserIdCallbackFn = function(id) {
alert('received id is: ' + id);
}

var appsFlyerId = window.plugins.appsFlyer.getAppsFlyerUID(getUserIdCallbackFn);

Purchasely.setAttribute(Purchasely.Attribute.APPSFLYER_ID, appsFlyerId);
private PurchaselyRuntime.Purchasely _purchasely;

_purchasely.SetAttribute(PLYAttribute.APPSFLYER_ID, "test_appsflyer_id");

2. Activating the AppsFlyer integration

Retrieving your app id in the AppsFlyer Dashboard

  1. Go to your AppsFlyer dashboard: https://hq1.appsflyer.com/apps/myapps
  2. You will find your app's ids beneath their names

Retrieving your API key in the AppsFlyer Dashboard

  1. Go to your AppsFlyer dashboard: https://hq1.appsflyer.com/apps/myapps
  2. Using the app's top right menu, access your app's settings
  1. You will find your app's API key at the top of the page
  1. (optional) repeat for your Android / iOS app

Enabling the AppsFlyer integration in the Purchasely Console

  1. Visit your Purchasely app's console
  2. Access your apps Integrations settings
  1. Access the AppsFlyer Integration's Settings

  2. Enable the AppsFlyer integration

  3. Set your iOS AppsFlyer app's API key & app ID

  4. Set your Android AppsFlyer app's API key & App ID

  1. (optional) Override the name of events sent to AppsFlyer

  2. Save


What’s Next

Learn how to integrate Branch with Purchasely