AppsFlyer
AppsFlyer is a mobile marketing analytics and attribution platform that helps you analyze and optimize your apps through marketing analytics, mobile attribution, and deep linking.
The Braze and AppsFlyer integration allows you to better understand how to optimize and build more holistic campaigns by leveraging mobile install attribution data from AppsFlyer.
Prerequisites
Requirement | Description |
---|---|
AppsFlyer account | An AppsFlyer account is required to take advantage of this partnership. |
iOS or Android app | This integration supports iOS and Android apps. Depending on your platform, code snippets may be required in your application. Details on these requirements can be found in step 1 of the integration process. |
AppsFlyer SDK | In addition to the required Braze SDK, you must install the AppsFlyer SDK. |
Integration
Step 1: Map device ID
Android
If you have an Android app, you will need to pass a unique Braze device ID to AppsFlyer.
Make sure the following lines of code are inserted at the correct place—after the Braze SDK is launched and before the initialization code for the AppsFlyer SDK. See the AppsFlyer Android SDK integration guide for more information.
1
2
3
4
HashMap<String, Object> customData = new HashMap<String,Object>();
String deviceId =(Braze.getInstance(MyActivity.this).getDeviceId());
customData.put("brazeCustomerId", deviceId);
AppsFlyerLib.setAdditionalData(customData);
iOS
Prior to February 2023, our AppsFlyer attribution integration used the IDFV as the primary identifier to match iOS attribution data. It is not necessary for Braze customers using Objective-C to fetch the Braze device_id
and sent to AppsFlyer upon install as there will be no disruption of service.
For those using the Swift SDK v5.7.0+, if you wish to continue using IDFV as the mutual identifier, you must ensure that the useUUIDAsDeviceId
field is set to false
so there is no disruption of the integration.
If set to true
, you must implement the iOS device ID mapping for Swift in order to pass the Braze device_id
to AppsFlyer upon app install in order for Braze to appropriately match iOS attributions.
1
2
3
4
5
6
7
8
9
BRZConfiguration *configurations = [[BRZConfiguration alloc] initWithApiKey:@"BRAZE_API_KEY" endpoint:@"BRAZE_END_POINT"];
[configurations setUseUUIDAsDeviceId:NO];
Braze *braze = [[Braze alloc] initWithConfiguration:configurations];
[braze deviceIdWithCompletion:^(NSString * _Nonnull brazeDeviceId) {
NSLog(@">>[BRZ]: %@", brazeDeviceId);
[[AppsFlyerLib shared] setAdditionalData:@{
@"brazeDeviceId": brazeDeviceId
}];
}];
Swift completion handler
1
2
3
4
5
6
7
8
9
let configuration = Braze.Configuration(
apiKey: "<BRAZE_API_KEY>",
endpoint: "<BRAZE_ENDPOINT>")
configuration.useUUIDAsDeviceId = false
let braze = Braze(configuration: configuration)
braze.deviceId {
brazeDeviceId in
AppsFlyerLib.shared().customData = ["brazeDeviceId": brazeDeviceId]
}
Swift await
1
2
3
4
5
6
7
let configuration = Braze.Configuration(
apiKey: "<BRAZE_API_KEY>",
endpoint: "<BRAZE_ENDPOINT>")
configuration.useUUIDAsDeviceId = false
let braze = Braze(configuration: configuration)
let brazeDeviceId = await braze.deviceId()
AppsFlyerLib.shared().customData = ["brazeDeviceId": brazeDeviceId]
Unity
1
2
3
4
Appboy.AppboyBinding.getDeviceId()
Dictionary<string, string> customData = new Dictionary<string, string>();
customData.Add("brazeCustomerId", Appboy.AppboyBinding.getDeviceId());
AppsFlyer.setAdditionalData(customData);
Step 2: Get the Braze data import key
In Braze, navigate to Partner Integrations > Technology Partners and select AppsFlyer.
If you are using the older navigation, you can find Technology Partners under Integrations.
Here, you will find the REST endpoint and generate your Braze data import key. Once generated, you can create a new key or invalidate an existing one. The data import key and the REST endpoint are used in the next step when setting up a postback in AppsFlyer’s dashboard.
Step 3: Configure Braze in AppsFlyer’s dashboard
- In AppsFlyer, navigate to the Integrated Partners page on the left bar. Next, search for Braze and click on Braze’s logo to open up a configuration window.
- Within the Integration tab, switch on Activate Partner.
- Provide the data import key and REST endpoint that you found in Braze’s dashboard.
- Toggle Advanced Privacy off and save your configuration.
Additional information on these instructions is available in AppsFlyer’s documentation.
Step 4: Confirm the integration
Once Braze receives attribution data from AppsFlyer, the status connection indicator on the AppsFlyer technology partners page in Braze will change from “Not Connected” to “Connected”. A timestamp of the last successful request will also be included.
Note that this will not happen until we receive data about an attributed install. Organic installs, which should be excluded from the AppsFlyer postback, are ignored by our API and are not counted when determining if a successful connection was established.
Step 5: Viewing user attribution data
Available data fields
Assuming you configure your integration as suggested, Braze will map all organic and non-organic install data to segment filters.
AppsFlyer data field | Braze segment filter |
---|---|
media_source |
Attributed Source |
campaign |
Attributed Campaign |
af_adset |
Attributed Adgroup |
af_ad |
Attributed Ad |
Your user base can be segmented by attribution data in the Braze dashboard using the Install Attribution filters.
Additionally, attribution data for a particular user is available on each user’s profile in the Braze dashboard.
Facebook, Snapchat, and Twitter attribution data
Attribution data for Facebook and Twitter campaigns is not available through our partners. These media sources do not permit their partners to share attribution data with third parties and, therefore, our partners cannot send that data to Braze.
Email deep linking and click tracking
Deep links, links that direct users toward a specific page or place within an app or website, are crucial in creating a tailored user experience. While widely used, issues often come up when using them with click tracking, another vital feature used in collecting user data. These issues are due to ESPs (Email Service Providers) wrapping deep links in their own click recording domain, breaking the original link.
There are, however, ESPs like SendGrid that support both universal linking and click tracking. Braze recommends integrating OneLink-based attribution links into your SendGrid or SparkPost email system to seamlessly deep link from emails.
AppsFlyer click tracking URLs in Braze (optional)
You can use AppsFlyer’s OneLink attribution links in Braze campaigns across push, email, and more. This allows you to send back install or re-engagement attribution data from their Braze campaigns into AppsFlyer. As a result, you’ll be able to measure your marketing efforts more effectively and make data-driven decisions on where to invest more resources for the maximum ROI.
You can simply create your OneLink tracking URL in AppsFlyer and directly insert it into your Braze campaigns. AppsFlyer will then use their probabilistic attribution methodologies to attribute the user that has clicked on the link. We recommend appending your AppsFlyer tracking links with a device identifier to improve the accuracy of attributions from your Braze campaigns. This will deterministically attribute the user that has clicked on the link.
For Android, Braze allows customers to opt-in to Google Advertising ID collection (GAID). The GAID is also collected natively through the AppsFlyer SDK integration. You can include the GAID in your AppsFlyer click tracking links by utilizing the following Liquid logic:
1
2
3
{% if most_recently_used_device.${platform} == 'android' %}
aifa={{most_recently_used_device.${google_ad_id}}}
{% endif %}
For iOS, both Braze and AppsFlyer automatically collect the IDFV natively through our SDK integrations. This can be used as the device identifier. You can include the IDFV in your AppsFlyer click tracking links by utilizing the following Liquid logic:
1
2
3
{% if most_recently_used_device.${platform} == 'ios' %}
idfv={{most_recently_used_device.${id}}}
{% endif %}
This recommendation is purely optional
If you currently do not use any device identifiers - such as the IDFV or GAID - in your click tracking links, or do not plan to in the future, AppsFlyer will still be able to attribute these clicks through their probabilistic modeling.