Cross-promotion attribution for developers

At a glance: Implement additional code in the AppsFlyer SDK to enable cross-promotion attribution.

Implementing cross-promotion attribution in the SDK

 Note

Regular mobile ads activate a URL when clicked. Cross-promotion mobile ads don't have a link, but instead, they activate the AppsFlyer SDK logAndOpenStore method.

Attributing cross-promotion clicks and impressions is performed by using two separate API calls as described below. Each API call can also be passed a map of key values, which can be anything that fits your cross-promotion use case. 

For example, using the map of parameters you can set the click lookback window and other parameters such as ad IDs, ad sets. You can also mark the campaign as incentivized campaigns. See AppsFlyer attribution parameter for more information. 

For a list of standard parameters that you can pass to the API method, see AppsFlyer attribution parameter.

With the first launch of the promoted app, all the original parameters can be accessed via the SDK's conversion data API, for Android or iOS.

Attribute cross-promotion clicks

Use the following code to attribute the click and launch the app store's app page. The code creates an attribution link and adds the device advertising ID to it.

Android iOS Unity - Android Unity - iOS
String campaign = "Cross Promo Campaign"; 
Map<String, String> parameters = new HashMap(); 
parameters.put("af_sub1", "val");
parameters.put("custom_param", "val2"); 
CrossPromotionHelper.logAndOpenStore(this, "com.mygosoftware.android.loginbox", campaign, parameters);

 Note

You can add any of these attribution link parameters to the generated link.

Attribute cross-promotion impressions

To attribute an impression use the following API call. Make sure to use the promoted App ID as it appears within the AppsFlyer dashboard.

Java Kotlin Objective C Swift Unity
String appID = "com.app";
String campaign = "Cross Promo Campaign";
Map<String, String> parameters = new HashMap();
parameters.put("af_sub1", "val");
parameters.put("custom_param", "val2");
CrossPromotionHelper.logCrossPromoteImpression(this, appID, campaign, parameters);

Attribute cross-promotion with non-native platforms

Currently, the cross-promotion attribution APIs are available only for native Android and iOS SDKs and for Unity. However, non-native platforms can perform cross-promotions attribution just as effectively. These include platforms such as Adobe air, Cordova, Xamarin, React native, Marmalade etc.

To do this you need to build an attribution Link, which is invoked when the user clicks on the cross-promotion ad. The link MUST contain the media source name af_cross_promotion and the site ID of the source app.

Clicks cross-promotion URL format:

https://app.appsflyer.com/{PROMOTED APP ID}?pid=af_cross_promotion&
af_siteid={SOURCE APP NAME}

Impressions cross-promotion URL format:

https://impression.appsflyer.com/{PROMOTED APP ID}?pid=af_cross_promotion&
af_siteid={SOURCE APP NAME}