AppsFlyer Remote Command Tag in Tealium iQ Tag Management
How It Works
The AppsFlyer integration uses the native AppsFlyer SDK, a remote commands module that wraps the AppsFlyer methods, and the AppsFlyer Remote Command tag that translates event tracking into native AppsFlyer calls. This solution leverages the convenience of Tealium iQ Tag Management to configure a native AppsFlyer implementation without having to add vendor-specific code to your app.
Adding the AppsFlyer remote command module to your app automatically installs and builds the required AppsFlyer libraries. If you are using a dependency manager installation, there is no need to install the AppsFlyer SDK separately.
iOS: For AppsFlyer version 4.8.11+, the SDK automatically adds the following native frameworks: AdSupport.framework and iAd.framework. Learn more in the AppsFlyer iOS SDK integration guide.
We recommend using one of the following dependency managers for installation:
If you are using the Tealium iOS (Objective-C) library, use the manual installation method. The CocoaPods and Carthage options are only available if you are using the Tealium iOS (Swift) library.
To install AppsFlyer remote commands for iOS using CocoaPods:
Remove tealium-swift and pod "AppsFlyerFramework" if they exist in your Podfile. The dependency for tealium-swift is already included in the TealiumAppsFlyer framework.
Add the following dependency to your Podfile:
The TealiumAppsFlyer pod includes the following TealiumSwift dependencies:
For all Tealium libraries, register the AppsFlyer Remote Command when you initialize.
The following code is designed for use with Tealium’s Android library:
privateval devKey ="<your_appsflyer_dev_key>"// Sets up a config object and creates a Tealium instance
val config: Tealium.Config= Tealium.Config.create(application, "your_account", "your_profile", "dev");
var tealium: Tealium = Tealium.createInstance(TEALIUM_MAIN, config)
// New code to add the AppsFlyer Remote Command
val appsFlyerRemoteCommand= AppsFlyerRemoteCommand(instanceName, application, appsFlyerDevKey = devKey)
The following code is designed for use with Tealium’s Swift library for iOS:
The following code is designed for use with Tealium’s Objective-C library for iOS, although it is written in Swift. A Bridging Header is required in your Xcode project for this code to work correctly.
// Sets up a config object and creates a Tealium instance.
let config = TEALConfiguration(account: "your_account",
let teal = Tealium.newInstance(forKey: "teal", configuration: config)
let appsFlyerCommand = AppsFlyerRemoteCommand(appsFlyerCommandTracker: AppsFlyerCommandTracker())
let appsFlyerRemoteCommand = appsFlyerCommand.remoteCommand()
teal.addRemoteCommandID("appsflyer", description: nil, targetQueue: DispatchQueue.main, responseBlock: appsFlyerRemoteCommand)
Push Message Tracking
The Tealium Swift library includes a TealiumRegistration protocol for handling push message tracking via Tealium and the AppsFlyer Remote Command. We conform to this protocol in AppsFlyerCommandTracker and is used to send push message authorization events, push message open events, and to uninstall tracking. We recommend taking advantage of the push message tracking capability.
The following steps integrate push message tracking for your iOS project:
In the TealiumHelper.swift file, initialize an empty array of objects that conform to the TealiumRegistration protocol. For example:
To see the entire TealiumHelper.swift file, explore the AppsFlyer Remote Command sample app. To send an event to AppsFlyer once a user has registered for notifications, opened a push message, or uninstalled the app, see the file AppDelegate.swift.
Manually called in AppDelegate within didRegisterForRemoteNotificationsWithDeviceToken
Standard Event Names
The following is a list of standard event names supported with the trackEvent method. If any of the below command names are sent, they are automatically triggered in the AppsFlyer SDK. This is assuming all the required variables are also mapped and defined for that particular event. Learn more about recording in-app events and the see the full list of recommended in-app events per vertical.
AppsFlyer Event Name
Since the AppsFlyer SDK is installed alongside the Tealium SDK, you are able to trigger any native AppsFlyer functionality given the corresponding tag configuration.
The AppsFlyer SDK is initialized automatically upon launch. The AppsFlyer API key is set in the tag configuration.