How can I connect Batch to AppsFlyer?
You can use AppsFlyer attribution data to improve your segmentation within Batch. The connection only requires a quick code addition.
Understanding how the connection works
iOS integration
import AppsFlyerLib
import Batch
extension AppDelegate: AppsFlyerLibDelegate {
func onConversionDataSuccess(_ conversionData: [AnyHashable : Any]) {
BatchProfile.editor { editor in
if let mediaSource = conversionData["media_source"] as? String {
try? editor.set(attribute: mediaSource, forKey: "appsflyer_source")
}
if let campaignId = conversionData["campaign"] as? String {
try? editor.set(attribute: campaignId, forKey: "appsflyer_campaign")
}
if let adSet = conversionData["af_adset"] as? String {
try? editor.set(attribute: adSet, forKey: "appsflyer_adset")
}
}
}
func onConversionDataFail(_ error: any Error) {
}
}Android integration
What’s next?

Last updated

