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:

AppsFlyer SDK v5.0 or higher:

Swift
Objective C
Java
Kotlin
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)
)
}

For an earlier version of AppsFlyer SDK:

Swift
Objective-C
Swift
import AppsFlyerLib
​
extension AppDelegate: AppsFlyerTrackerDelegate {
func onConversionDataReceived(_ installData: [AnyHashable : Any]!) {
Qonversion.addAttributionData(installData, from: .appsFlyer, userID: AppsFlyerTracker.shared().getAppsFlyerUID())
}
func onConversionDataRequestFailure(_ error: Error!) {
}
}
Objective-C
#import <AppsFlyerTracker/AppsFlyerTracker.h>
​
@interface AppDelegate: UIResponder <UIApplicationDelegate, AppsFlyerTrackerDelegate>
​
- (void)onConversionDataReceived:(NSDictionary *)installData {
[Qonversion addAttributionData:installData fromProvider:QAttributionProviderAppsFlyer userID:[[AppsFlyerTracker sharedTracker] getAppsFlyerUID]];
}
​
- (void)onConversionDataRequestFailure:(NSError *)error {
​
}
​
@end

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. Provide the SDK Key (in your AppsFlyer account: Configuration β†’ App Settings β†’ Dev Key) and App ID (e.g., id1234567891, including "id") under your app's AppsFlyer integration section in the Qonversion account.

Enter any custom event names for purchase events (here you can see all tracked events and their default names):

Qonversion Integrations section

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',
}
}

​

​