Integrating AppsFlyer analytics into a mobile application

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
Integrating AppsFlyer analytics into a mobile application
Medium
from 1 business day to 3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1054
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Integrating AppsFlyer analytics into a mobile application

AppsFlyer — primarily an MMP (Mobile Measurement Partner), not just analytics. Its key task — attribution: determine which ad network the user installing the app came from. Without an MMP, you can't correctly compare ROI of Facebook Ads and Google UAC: both platforms will claim the same user.

How AppsFlyer attribution works

When clicking an ad, AppsFlyer saves a fingerprint or click_id. After installation and first app launch, the SDK sends an install event to AppsFlyer server. The server matches install with click through deterministic method (click_id in deeplink) or probabilistic (IP + User-Agent). Result: accurate information about campaign, ad group and ad that brought the user.

SDK connection

iOS via Swift Package Manager — AppsFlyerLib-iOS:

import AppsFlyerLib

// AppDelegate
func application(_ application: UIApplication,
                 didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    AppsFlyerLib.shared().appsFlyerDevKey = "YOUR_DEV_KEY"
    AppsFlyerLib.shared().appleAppID = "YOUR_APP_STORE_ID"
    AppsFlyerLib.shared().delegate = self
    AppsFlyerLib.shared().isDebug = false // debug builds only!
    return true
}

// SceneDelegate or applicationDidBecomeActive
func applicationDidBecomeActive(_ application: UIApplication) {
    AppsFlyerLib.shared().start()
}

Android:

implementation("com.appsflyer:af-android-sdk:6.+")
// Application.onCreate()
AppsFlyerLib.getInstance().init("YOUR_DEV_KEY", conversionDataListener, this)
AppsFlyerLib.getInstance().start(this)

start() on Android must be called in Application.onCreate(), not in Activity — otherwise deeplink attribution on cold start from deeplink will be inaccurate.

In-app events for campaign optimization

AppsFlyer sends in-app events to ad networks for algorithmic optimization (Conversions API, SKAdNetwork on iOS):

AppsFlyerLib.shared().logEvent(
    AFEventPurchase,
    withValues: [
        AFEventParamRevenue: 990.0,
        AFEventParamCurrency: "RUB",
        AFEventParamContentId: "sku_123",
        AFEventParamOrderId: "order_456"
    ]
)

Standard constants AFEventPurchase, AFEventAddToCart, AFEventCompleteRegistration — these are strings matching Facebook and Google format. Use them instead of arbitrary names so ad networks correctly interpret events.

SKAdNetwork and iOS 14+

Starting iOS 14, Apple limited deterministic attribution through ATT. AppsFlyer implements SKAdNetwork attribution: conversion value (6 bits) encodes user information and transmits to Apple aggregately. AppsFlyer automatically manages updateConversionValue through dashboard configuration — you don't need to implement this manually.

// Conversion Value requires calling start() with ATT status
AppsFlyerLib.shared().waitForATTUserAuthorization(timeoutInterval: 60)
// ... after ATT request:
AppsFlyerLib.shared().start()

Deeplink and OneLink

OneLink — AppsFlyer technology for universal links working both on iOS (Universal Links) and Android (App Links) and when app not installed, directing to installation page:

// AppDelegate
func application(_ application: UIApplication,
                 continue userActivity: NSUserActivity,
                 restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
    AppsFlyerLib.shared().continue(userActivity, restorationHandler: nil)
    return true
}

func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
    AppsFlyerLib.shared().handleOpen(url, options: options)
    return true
}

Typical integration mistakes

isDebug = true in production — direct attribution data leak (debug traffic goes to separate stream and isn't counted in real campaigns). Must check through Build Configuration.

Missing waitForATTUserAuthorization on iOS 14+: without pause, AppsFlyer sends install before getting ATT permission, and attribution will be probabilistic even if user later agreed.

What's included in the work

  • SDK connection for iOS/Android
  • DEV Key and App ID setup
  • In-app events for key conversions
  • SKAdNetwork configuration for iOS 14+
  • OneLink / Universal Links / App Links setup
  • Integration with ad networks through postbacks (if required)

Timeline

Basic attribution with in-app events: 1–2 days. Full integration with OneLink and SKAdNetwork: up to 3 days. Cost calculated individually.