AppsFlyer and mParticle Integration

Introduction

mParticle collects customer data and sends it to different analytics, marketing and data warehousing platforms.

Event Integrations

The purpose of this document is to provide you with details of how to activate event data from mParticle to AppsFlyer.

1.  mParticle customers must integrate the AppsFlyer SDK into their application

2.  Refer to the iOS and Android SDK GitHub repositories for details on how to configure the AppsFlyer kit with the mParticle SDK into your app.

Configure the AppsFlyer Event Integration

1.  From the mParticle dashboard (https://app.mparticle.com), select your App (aka Workspace)

2.  Click Directory from the left navigation

3.  Click the AppsFlyer tile to display the integration details which provide information regarding the integration such as Categories, Available Platforms, Minimum mParticle SDK versions (if any), Data Types, User IDs, Device IDs and Available events, User IDs, Device IDs and Available Configurations.

4.  Click Add AppsFlyer to Setup.

The Add to Setup window opens:

5.  Select the Output Event Integration Type and click Add to Setup to open the Event Configuration Setup screen where you can continue the configuration process.

6.  Enter the AppsFlyer configuration settings and click Save:

  • Configuration Name
  • User same settings for Development and Production
  • Dev Key
  • The configuration you just created is shown under the AppsFlyer Default Group

The next step is to establish a connection between your input platforms to the AppsFlyer output event configuration.  

7.  Click Connections.

8.  Select the Input (iOS in this example) and then click Connect Output.

9.  Select the AppsFlyer tile and then select the AppsFlyer configuration created above.

10.  Enter the AppsFlyer Connection settings:

Apple App ID (enter the number only and not the ID prefix. For example, if your App ID is id123456789 enter 123456789)

11.  Click Add Connection.

AppsFlyer is now shown as a Connected Output  Further options, such as Custom Mappings, may be available. See mParticle’s documentation for more.

Feed Integrations

This section helps you understand how to connect a data feed from AppsFlyer to mParticle.  

General integration information for AppsFlyer can be found at http://docs.mparticle.com/integrations/AppsFlyer/.  

1.  From the mParticle Dashboard (https://app.mparticle.com), select your App (aka Workspace)

2.  Click Directory from the left navigation

3.  Click the AppsFlyer tile to display the integration details which provide information regarding the integration.

 

4.  Click Add AppsFlyer to Setup.

5.  Select the Input Feed Integration Type and click Add to Setup.  

You are now taken to the Setup screen where you can continue the configuration process.

6.  Enter the AppsFlyer configuration settings and click Create:

  • Configuration Name
  • Act as Application

 

7. Complete the setup in the AppsFlyer dashboard using the authentication information provided.

Deferred Deep Linking

AppsFlyer allows you to access the user attribution data in real time directly at the SDK level. It enables you to customize the landing page a user sees on the very first app open after a fresh app install. This is commonly referred to as “deferred” deep linking.

For more details of deferred deep linking, click here.

AppsFlyer's conversion data contains a parameter called is_First_Launch. The value of is_First_Launch is 'true' on first launches only, and 'false' on all following launches. You can use this parameter to determine on every launch if the app should defer deep link the user or not.

af_dp → $deeplink_path

Example

$deeplink_path=product/Banana-Pet-Costume/dd67268672b345e491656c871af8aa29

af_dp includes the encoded URI scheme and pathway

af_dp

%20jet%3A%2F%2Fproduct%2FBanana-Pet-Costume%2Fdd67268672b345e491656c871af8aa29

 

Android iOS
For Android: Perform this with Shared Preferences: here.
//you can call this at anytime after MParticle.start().
 MParticle.getInstance().checkForDeepLink(new DeepLinkListener() {
    @Override
    public void onResult(DeepLinkResult deepLinkResult) {
        if (deepLinkResult.getServiceProviderId() == MParticle.ServiceProviders.APPSFLYER) {
            if (deepLinkResult.getParameters().has(AppsFlyerKit.INSTALL_CONVERSION_RESULT)) {
                Log.d("Conversion result", deepLinkResult.toString());
            } else if (deepLinkResult.getParameters().has(AppsFlyerKit.APP_OPEN_ATTRIBUTION_RESULT)) {
                Log.d("App open result", deepLinkResult.toString());
            }
        }
    }

	@Override
    public void onError(DeepLinkError deepLinkError) {
        Log.d("Deep link error", deepLinkError.toString());
    }
});

AppsFlyer/mParticle Use Cases

Use Case Platform AppsFlyer SDK Method mParticle-AF Kit Method

Deferred Deep Llinking

iOS

onConversionDataReceived

checkForDeferredDeepLinkWithCompletionHandler

Universal Links

iOS

continueUserActivity

continueUserActivity

App Open

iOS

onAppOpenAttribution

checkForDeferredDeepLinkWithCompletionHandler

Deferred Deep Linking

Android

onInstallConversionDataLoaded

checkForDeepLink

Android App Links

Android

<intent-filter android:autoVerify="true">

continueUserActivity

App Open

Android

onAppOpenAttribution

checkForDeepLink

Handling User Flags

AppsFlyer also enables you to serve personalized content or to send existing users to specific locations in the app AFTER the initial launch. When existing users are deep linked into the app, the app opens from onOpenAttribution method, which returns the referring URL data. 

 if let conversionData = params?[MPKitAppsFlyerConversionResultKey] as? [AnyHashable: Any], !alreadyLoggedAppsflyerConversionData {
            logAppsflyerConversionData(conversionData: conversionData)
            alreadyLoggedAppsflyerConversionData = true
            if let onelinkURL = (conversionData["af_dp"] as? String).flatMap(URL.init) {
                UIApplication.appDelegate._linkController.handle(onelinkURL, source: .appsflyer)
            }
        } else if let appOpenData = params?[MPKitAppsFlyerAppOpenResultKey] as? [AnyHashable: Any] {
            logAppsflyerAppOpenData(appOpenData: appOpenData as? [String: Any])
        }

AppsFlyer uses iOS UserDefaults and Android Shared Preferences to indicate whether the user is opening the app for the first time and should be redirected to the appropriate page, or if the app has already been opened and the user has already been directed to that page. To do this, the alreadyLoggedAppsflyerConversionData value is read and written to UserDefaults/SharedPreferences, so that the value af_dp is not looked at on the first launch.

For more details about serving personalized content on deep linking click here

Known mParticle Integration Limitation

AppsFlyer uninstall tracking is not automatically enabled with the mParticle-AppsFlyer SDK kit.

The AppsFlyer instance on mParticle must be configured to track app uninstalls.

To implement uninstall tracking, for either iOS or Android, please call AppsFlyer methods directly by following our uninstall tracking documentation outlined here.

Was this article helpful?
0 out of 0 found this helpful