Skip to main content
All Collections3rd-party integrationsAttribution
How can I track campaign retargeting with AppsFlyer?
How can I track campaign retargeting with AppsFlyer?

Yes! Thanks to a quick client-side integration, you will be able to see campaigns opens with AppsFlyer.

Baptiste avatar
Written by Baptiste
Updated over a year ago

AppsFlyer is extensive analytics that helps brands keep track of their attribution and engagement campaigns while providing a large variety of analytics. 

This client-side integration will allow you to retrieve Batch push notifications that opens in the Retargeting section as in the screenshot below:

1. Enabling AppsFlyer SDK to pick up opens

Follow the steps described in the official AppsFlyer documentation. The AppsFlyer SDK will be able to track push opens: iOS / Android.

2. Adding AppsFlyer data in the push payload

Simply add these few lines in your Batch Custom Payload to enable the notification to be tracked down by the AppsFlyer SDK:

⚠️ Please note that the payloads to be used for iOS and Android are not the same.

iOS

{
"data":{
"af":{
"pid":"batch_int",
"is_retargeting":"true",
"c":"test_campaign"
}
}
}

Android

{
"af":{
"pid":"batch_int",
"is_retargeting":"true",
"c":"test_campaign"
}
}

Here is where you will need to paste the payload:

Note that an extra step is needed on Android. You need to add the following code before calling the AppsFlyer AppsFlyerLib.getInstance().sendPushNotificationData method:

if (intent != null) {
  val batchPayload = intent.getBundleExtra(Batch.Push.PAYLOAD_KEY)
val af: String? = batchPayload?.getString("af")
if (batchPayload != null && af != null) {
intent = intent.putExtra("af", af)
}

}

3. Record push notifications data on AppsFlyer

AppsFlyer allows you to record push notifications as part of retargeting campaigns by calling the methods documented here: iOS / Android


This article belongs to Batch's FAQ. Need more help? Find insightful articles, documentation, case & market studies, guides, and even more in our website's Resources section on batch.com and our blog.

Did this answer your question?