At a glance: Send data to Adobe Launch SDK and AppsFlyer SDK with the single implementation of AppsFlyer Adobe Launch SDK Extension.
Overview
The Adobe Launch SDK is an integral part of the Adobe Experience Platform. Adobe Experience Platform helps businesses gather, consolidate, and analyze data from multiple apps and platforms. It allows business owners and developers to better understand customer behavior in order to optimize experience and content delivery. If your app implements both the Adobe Launch SDK and the AppsFlyer SDK, you can send data to both with a single implementation of AppsFlyer Adobe Launch SDK Extension. It reduces the overall complexity of your development process and makes for a cleaner and maintainable codebase.
Note
If you're using the Adobe Launch extension, there's no need for the standard Adobe Analytics integration.
Prerequisites
A few things are required before integrating AppsFlyer Adobe SDK Extension.
Get your AppsFlyer dev key
- In your app's dashboard, click on App Settings under Configuration in the left-hand menu.
- Under SDK Installation, copy the Dev Key.
Get your app ID
- For Android - the app ID is the package name, e.g. example.com.app.
- For iOS - the app ID is the app's iTunes ID without the id prefix, e.g. 123456748.
Step 1: Configuring Adobe Launch
Follow the instructions here to configure Adobe Launch.
1.1 Creating a new property in Adobe Launch
1.2 Installing required Adobe Launch extensions
Install the following extensions in Adobe Launch:
- Adobe Analytics - connects the recorded data from the SDK to the Adobe Analytics module.
- AppsFlyer SDK Extension - sends data and events to both Adobe and AppsFlyer using the Adobe Launch SDK.
- Adobe Profile - allows the SDK to store data into a client-side profile.
- Adobe Mobile Core - allows configuration of the mobile SDK and provides access to default lifecycle events and conditions.
Installing Adobe Analytics extension
- Log in to Adobe Analytics.
- Create a report suite.
- Log back into Adobe Launch.
- From the list of properties, click on the property that you created earlier.
- Click Extensions.
- Search for and install Adobe Analytics.
- Under Report Suites, specify the report suite that you created in step 2.
- Click Save.
Installing AppsFlyer SDK Extension
- Select Extensions again.
- Search for and install AppsFlyer SDK Extension.
- Under AppsFlyer iOS App ID, specify the iOS app ID that you got in the prerequisites step.
- Under AppsFlyer Dev Key specify the dev key that you got in the prerequisites step.
- Enable Send attribution data to Adobe Analytics. Note that there are some restrictions on sharing user-level data with 3rd-party analytics platforms.
- Click Save.
Install Profile and Mobile Core extension
- Select Extensions again.
- Search for and install Profile.
- Search for and install Mobile Core.
- When installing Mobile Core, simply save the extension as is. There is no need to specify the Experience Cloud Server.
Step 2: Implementing AppsFlyer Adobe SDK Extension
Follow the instructions in this section to Implement the Adobe SDK Extension into your app.
2.1 Adding the SDK to the app
- Inside your Adobe property, select Environments.
- Select the environment for which you want to deploy the SDK.
- On the right-hand side, click the box icon.
- Copy the code snippets from the window that opens and follow the instructions. If you're the marketer configuring Adobe, send these code snippets to your app developer.
2.2 Publishing the environment
To complete the SDK implementation, you need to publish the environment to a library.
- Inside your Adobe property, select Publishing.
- Click Add New Library.
- Give it a name and under Environment, select Development.
- Click Save & Build for Development.
- Once the build completes, under Development, click the three dots next to the library and select Submit for Approval.
- Under Submitted, click the three dots next to the library and select Build for Staging.
- Once the build completes, click the three dots next to the library and select Approve for Publishing.
- Under Approve, click the three dots next to the library and select Build & Publish to Production.
2.3 Adding Android install referrer to your app
The Android Install Referrer improves attribution accuracy, protects from install fraud, and more. It is supported from AppsFlyer Android SDK version 4.8.6.
Note
Google deprecated the BroadcastReceiver in March 2020.
- This change does not affect the app.
- You may still need the BroadcastReceiver for out-of-store attribution. Check with the store where the app is listed to make sure.
- Implementing the install referrer is now mandatory.
There are two ways to add the install referrer to your app:
- Using Gradle (recommended)
- Manually adding the install referrer
Add the Android Install Referrer as a dependency. You can find the latest version here.
-
dependencies { //make sure to use the latest SDK version: https://mvnrepository.com/artifact/com.appsflyer/af-android-sdk implementation 'com.appsflyer:af-android-sdk:5.+' implementation 'com.android.installreferrer:installreferrer:1.1' }
- Sync the project to retrieve the dependencies - see the following screenshot:
If you are using ProGuard and want to use Google's new referrer API, set the following ProGuard rule: -dontwarn com.android.installreferrer
- Download the Install Referrer aar
- Add it to the project
- Add the following permission to the manifest:
com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE
2.4 Setting required permissions
Adding permissions helps increase the rate of Probabilistic modeling attribution. It also allows the SDK to send more data like Wifi and carrier network data. You can find this data in raw data reports and use it for analysis and optimization of campaigns.
Add Required Permissions
- Add the following permissions to AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <!-- Optional : --> <uses-permission android:name="android.permission.READ_PHONE_STATE" />
Using the Adobe SDK extension
Now you can start using the Adobe SDK extension to send data to Adobe and AppsFlyer.
Note
Currently, the Adobe Launch SDK extension only supports getting conversion data and sending events. However, when you add Adobe Launch SDK extension to your app, AppsFlyer SDK is also added. Therefore, any functionality currently missing from Adobe SDK extension can be implemented using AppsFlyer SDK.
Sending events
In-App events provide insight into what is happening in your app. We recommend taking the time and defining the events you want to record. Recording in-app events helps you measure KPIs such as ROI (Return on Investment) and LTV (Lifetime Value).
Adobe Launch SDK extension allows you to send in-app event data to both Adobe and AppsFlyer. You can then use Adobe Analytics to analyze user behavior and AppsFlyer to analyze ROI and LTV.
final Map<String,String> eventMap = new HashMap<>();
eventMap.put("currency", "USD");
eventMap.put("revenue", "200");
eventMap.put("freehand", "param");
MobileCore.trackAction("af_purchase", eventMap);
[ACPCore trackAction:@"af_purchase data:@{@"revenue":@"200",@"currency":@"USD"];
Sending the events as specified in the code above creates an event in AppsFlyer dashboard called af_purchase with a revenue of 200 USD. This event is also sent to and appears in Adobe Analytics.
All conversion data that is sent with events is prefixed by appsflyer. See the following table for examples:
Prefixed conversion data variables |
---|
appsflyer.af_click_lookback |
appsflyer.install_time |
appsflyer.cost_cents_USD |
appsflyer.media_source |
appsflyer.af_adset |
appsflyer.click_time |
appsflyer.orig_cost |
appsflyer.campaign |
Conversion data is used in the app that you create in Adobe Mobile Services. There are other parameters that can appear in conversion data. To learn more, click here.
Getting data for deep linking and deferred deep linking
Deep linking and deferred deep linking allow you to improve your user experience. They allow you to open the app in specific activities and customize the content according to the campaign data.
To get data from deep linking, implement the extension callbacks.
In the global application class, implement the following code:
AppsFlyerAdobeExtension.registerAppsFlyerExtensionCallbacks(new AppsFlyerExtensionCallbacksListener() {
@Override
public void onCallbackReceived(Map<String, String> callback) {
Log.d(AppsFlyerLibCore.LOG_TAG, callback.toString());
if(callback.get("callback_type").equals("onConversionDataReceived")){
// conversion data returned
if(callback.get("is_first_launch").equals("true")){
String af_status = callback.get("af_status");
if(af_status.equals("Non-organic")){
Log.d(AppsFlyerLibCore.LOG_TAG, "this is first launch and a non organic install!");
}
}
} else if(callback.get("callback_type").equals("onAppOpenAttribution")){
// direct deeplink - redirect user
Log.d(AppsFlyerLibCore.LOG_TAG, callback.toString());
}
}
@Override
public void onCallbackError(String errorMessage) {
Log.d("TAG", errorMessage);
}
});
In AppDelegate.m, implement the following code:
[AppsFlyerAdobeExtension registerCallbacks:^(NSDictionary *dictionary) {
NSLog(@"[AppsFlyerAdobeExtension] Received callback: %@", dictionary);
if([[dictionary objectForKey:@"callback_type"] isEqualToString:@"onConversionDataReceived"]){
if([[dictionary objectForKey:@"is_first_launch"] boolValue] == YES){
NSString* af_status = [dictionary objectForKey:@"af_status"];
if([af_status isEqualToString:@"Non-organic"]){
NSLog(@"this is first launch and a non organic install!");
}
}
} else if([[dictionary objectForKey:@"callback_type"] isEqualToString:@"onAppOpenAttribution"]) {
NSLog(@"onAppOpenAttribution Received");
}
}];
[AppsFlyerAdobeExtension callbacksErrorHandler:^(NSError *error) {
NSLog(@"[AppsFlyerAdobeExtension] Error recieving callback: %@" , error);
}];
Connecting AppsFlyer conversion data
Conversion data is sent with events to the Adobe platform. These variables allow you to apply logic and rules to reporting dimensions, metrics, or filters.
- Log in to your Adobe Mobile Services.
- Select the relevant app and enter the Manage Variables & Metrics page.
- Select the Custom Variables tab and configure the variables to map AppsFlyer SDK data to the Adobe system.
- For each custom variable, enter a meaningful name.
- Select or type the mapped AppsFlyer conversion data and choose your preferred Persistence scope.
See the following table for mapping AppsFlyer Context variables:
Recommended name to map |
Conversion data |
---|---|
AppsFlyer Lookback Window |
appsflyer.af_click_lookback |
AppsFlyer Install Time |
appsflyer.install_time |
AppsFlyer Cost Cents US |
appsflyer.cost_cents_USD |
AppsFlyer MediaSource |
appsflyer.media_source |
AppsFlyer Adset |
appsflyer.af_adset |
AppsFlyer Click Time |
appsflyer.click_time |
AppsFlyer Original Cost |
appsflyer.orig_cost |
AppsFlyer Campaign |
appsflyer.campaign |
Using AppsFlyer mapped conversion data for Analytics and Analysis
All data coming from the SDK is available in the Adobe Analytics report suite that is connected to the app.
You can use the data and its related dimensions and metrics across your generated Adobe Analytics reports and dashboards. This data is also available in the AppsFlyer dashboard for attribution and in-app event analysis.