AppsFlyer

#attribution

Measure what drives your revenue by tracking free-trial conversion to paid subscriptions, renewals, and even refunds. Qonversion sends data directly to your AppsFlyer account to help you understand your marketing performance.

Qonversion tracks revenue even if a user does not open your app. This allows you to measure the performance of each subscription plan with 100% accuracy.

‌Use this integration to:

  • Track trial starts, trial conversions, purchases, subscriptions, and renewals attributable to your ads. Please see the list of all the events here.

  • Measure the actual return on your ad spend.

  • Analyze your retention and make informed decisions.

Getting Started

1. You need to have AppsFlyer SDK integrated in your app before starting with this integration. If you do not have AppsFlyer integration yet, please use this documentation.

2. AppsFlyer requires to use the appsFlyerUIDparameter to match the attribution with the Appsflyer device ID.

3. Attribute data to users:

Swift
Objective C
Java
Kotlin
Unity
Swift
import AppsFlyerLib
​
extension AppDelegate: AppsFlyerTrackerDelegate {
​
func onConversionDataSuccess(_ conversionInfo: [AnyHashable : Any]!) {
Qonversion.addAttributionData(conversionInfo, from: .appsFlyer, userID: AppsFlyerTracker.shared()?.getAppsFlyerUID())
}
func onConversionDataFail(_ error: Error!) {
}
}
Objective C
#import <AppsFlyerTracker/AppsFlyerTracker.h>
​
@interface AppDelegate: UIResponder <UIApplicationDelegate, AppsFlyerTrackerDelegate>
​
- (void)onConversionDataSuccess:(NSDictionary *)conversionInfo {
[Qonversion addAttributionData:conversionInfo fromProvider:QAttributionProviderAppsFlyer userID:[[AppsFlyerTracker sharedTracker] getAppsFlyerUID]];
}
​
- (void)onConversionDataFail:(NSError *)error {
​
}
​
@end
Java
@Override
public void onConversionDataSuccess(final Map<String, Object> conversionData) {
Qonversion.getInstance().attribution(
conversionData,
AttributionSource.APPSFLYER,
AppsFlyerLib.getInstance().getAppsFlyerUID(this)
);
}
Kotlin
override fun onConversionDataSuccess(conversionData: Map<String, Any>) {
Qonversion.instance?.attribution(
conversionData,
AttributionSource.APPSFLYER,
AppsFlyerLib.getInstance().getAppsFlyerUID(applicationContext)
)
}
Unity
using AppsFlyerSDK;
using QonversionUnity;
​
public class AppsFlyerObjectScript : MonoBehaviour , IAppsFlyerConversionData
{
void Start()
{
/* AppsFlyer.setDebugLog(true); */
AppsFlyer.initSDK("devkey", "appID", this);
AppsFlyer.startSDK();
}
​
public void onConversionDataSuccess(string conversionData)
{
Dictionary<string, object> conversionDataDictionary = AppsFlyer.CallbackStringToDictionary(conversionData);
Qonversion.AddAttributionData(conversionData, AttributionSource.AppsFlyer, AppsFlyer.getAppsFlyerId());
}
}

Do not track any purchase events on the client side

Qonversion tracks and sends all revenue events so if you track revenue events with AppsFlyer SDK, you may double count the revenue in your AppsFlyer account.

4. Configure the event names and activate the integration from the Qonversion dashboard. Go to the integrations dashboard and choose AppsFlyer:

5. Provide the SDK Key (in your AppsFlyer account: Configuration → App Settings → Dev Key) and App ID.

You can find App ID in App Store URL:

For iOS: https://apps.apple.com/us/app/apple-developer/id640199958

For Android: https://play.google.com/store/apps/details?id=com.android.chrome

Done! Now your AppsFlyer account will start receiving the data from Qonversion.

Event Payload

{
'appsflyer_id' => '',
// Set up from SDK
'customer_user_id' => 'outside_uid',
'idfa' => '',
'eventName' => 'trial_converted',
'eventTime' => 'Y-m-d H:i:s.u',
'af_events_api' => 'true',
'eventValue' => {
'af_content_type' => 'product',
'af_content_id' => 'product_id',
'af_revenue' => '1.99',
'af_currency' => 'EUR',
}
}

​

​