AppsFlyer

Introduction

CleverTap can track the following information from AppsFlyer:

  • Install events
  • In-app events

Integrating AppsFlyer

To enable AppsFlyer integration with CleverTap dashboard, proceed as follows:

  1. Add CleverTap Credentials to AppsFlyer Dashboard
  2. Integrate AppsFlyer
  3. Enable the Attribution Partner

Add CleverTap Credentials to AppsFlyer Dashboard

To activate integration with CleverTap from AppsFlyer dashboard, follow the steps listed under CleverTap integration with AppsFlyer in AppsFlyer documentation.

AppsFlyer DashboardAppsFlyer Dashboard

AppsFlyer Dashboard

Integrate AppsFlyer

The integration steps vary for every app. The steps for every app are listed in the sections to follow:

For Android App

  1. To track attribution and events data in your Android app, perform the steps listed in AppsFlyer Android SDK Integration Guide.
  2. In your Android app code, add the following code.

For SDK version 4.2.0 and above
The getCleverTapAttributionIdentifier method is deprecated for CleverTap Android SDKs version 4.2.0 and above. Use the new getCleverTapID method to get the CleverTap ID on the OnInitCleverTapIDListener to set CustomerUserId method of AppsFlyer.

cleverTapInstance.getCleverTapID(new OnInitCleverTapIDListener() {
   @Override
   public void onInitCleverTapID(final String cleverTapID) {
       // Callback on main thread
       appsFlyerLib.setCustomerUserId(cleverTapID);
   }   
});
cleverTapInstance?.getCleverTapID {
  // Callback on main thread
  appsFlyerLib.setCustomerUserId(it)
}

For SDK version 4.1.1 and below

String attributionID = cleverTapInstance.getCleverTapAttributionIdentifier();
appsFlyerLib.setCustomerUserId(attributionID);
appsFlyerLib.setCustomerUserId(cleverTapInstance?.cleverTapAttributionIdentifier)

For iOS App

Add the following code to your iOS app code:

[CleverTap autoIntegrate];
[[AppsFlyerTracker sharedTracker] setCustomerUserID:[[CleverTap sharedInstance] profileGetCleverTapAttributionIdentifier]];

For React-Native

Add the following code to your React-Native app code:

CleverTap.profileGetCleverTapAttributionIdentifier((err, res) => { 

const userId = res;

appsFlyer.setCustomerUserId(userId, (response) => {   

//.. });

});

For Unity

Add the following code to your Unity app code:

string CleverTapID = CleverTapBinding.ProfileGetCleverTapID();
AppsFlyer.setCustomerUserId(CleverTapID);

For Cordova

Add the following code to your Cordova app code:

CleverTap.getCleverTapID(function(clevertapId) {
    window.plugins.appsFlyer.setAppUserId(clevertapId);
});

For Flutter

Add the following code to your Flutter app code:

CleverTapPlugin.getCleverTapID().then((clevertapId) {
      appsFlyerSdk.setCustomerUserId("clevertapId");
    });

Delay SDK Initialization for customerUserID

To set up delay SDK initialization for customerUserID in Android and iOS apps, we strongly recommend setting the customer user ID early in the app's flow. For more information about the setup, refer to Delay SDK initialization until CUID is set section.

Enable the Attribution Partner

After successful integration, AppsFlyer starts to push install event data to CleverTap. To receive in-app events in CleverTap from AppsFlyer, you need to enable the same in CleverTap and AppsFlyer dashboards, respectively. For more information about enabling this advanced setup, refer to Setup CleverTap section of AppsFlyer documentation and CleverTap Attribution Partner Settings.

Viewing Data in Dashboard

You can now view the event data in the CleverTap dashboard. To do so, proceed as follows:

  1. From the CleverTap dashboard, go to Analytics > Events.
  2. Apply the required filters for the selected event. The filters vary depending upon the type of event.

For Install Events: All the install events are tracked under the UTM Visited event.

Applying FiltersApplying Filters

Applying Filters

📘

Note

In-app events received from AppsFlyer are prefixed with AF in CleverTap.


Did this page help you?