Appsflyer is a mobile advertising attribution and analytics company. AppsFlyer helps marketers to pinpoint their targeting, optimize their ad spend and boost their ROI. 

On the other hand Batch can receive information from AppsFlyer using their callbacks attribution. This will allow you to re-target your users with notifications based on the installation source.

Understanding how the connection works

Callbacks provided by AppsFlyer SDK allow you to sync AppsFlyer data with Batch SDK. You will be able to use Batch segmentation to target users based on install source attribution data.

iOS integration

After having set up the AppsFlyer attribution callback (iOS instructions on callbacks), you simply have to send Batch the appropriate data via the SDK's method.

Here is an example of how you can set the callback in your app code (see more here):

-(void)onConversionDataReceived:(NSDictionary*) installData {
// initiate Batch user editor to set new attributes
BatchUserDataEditor *editor = [BatchUser editor];

[editor setAttribute:[installData objectForKey:@"media_source"] forKey:@"appsflyer_source"];
[editor setAttribute:[installData objectForKey:@"campaign"] forKey:@"appsflyer_campaign"];

// send new attributes to Batch servers [editor save];
}

Android integration

Similarly, you have to set up the AppsFlyer attribution callback (Android instructions) and sent Batch the attribution data via the SDK's method.

Here's an example on how you can set that callback in your app code (see more here):

AppsFlyerLib.getInstance().registerConversionListener(this, new AppsFlyerConversionListener() {

@Override
public void onInstallConversionDataLoaded(Map<String, String> conversionData) {
// initiate Batch user editor to set new attributes
BatchUserDataEditor editor = Batch.User.editor();

editor.setAttribute("appsflyer_source", conversionData.get("media_source"));
editor.setAttribute("appsflyer_campaign", conversionData.get("campaign"));

// send new attributes to Batch servers
editor.save();
}

});

What’s next?

Now, you can test your integration using our debug tool and find if your data work properly on the Batch dashboard. 

Once your tests are finished,  you will be able to specify an installation source and more from the campaign editor:

Now, it's super easy to target users based on attribution 😉.

Did this answer your question?