Remote Command: Adjust
Tealium remote command integration for Adjust on Android and Swift/iOS.
Requirements
- Adjust App Token
- One of these mobile libraries:
- Tealium for Android-Kotlin (1.0.0+)
- Tealium for Android-Java (5.9.0+)
- Tealium for iOS-Swift
- One of these remote command integrations:
- Adjust Remote Command JSON File (Requires Android-Kotlin 1.0.0+ or iOS-Swift 2.1.0+)
- Adjust Remote Command tag in Tealium iQ Tag Management
How It Works
The Adjust integration uses three items:
- The Adjust native SDK
- The remote commands module that wraps the Adjust methods
- Either the JSON configuration file or Remote Command tag that translates event tracking into native Adjust calls
Adding the Adjust remote command module to your app automatically installs and builds the required Adjust libraries, without having to add vendor-specific code to your app. If you are using a dependency manager installation, there is no need to install the Adjust SDK separately.
There are two remote command options: A JSON configuration file, or using iQ Tag Management to configure the mappings. A JSON configuration file is the recommended option for your vendor integration, hosted either remotely or locally within your app. If using iQ Tag Management, add the Remote Command tag for the vendor integration. Learn more about vendor integrations.
iOS: For Adjust version 4.23.0+, the SDK automatically adds the following native frameworks: AdSupport.framework
, iAd.framework
and AppTrackingTransparaceny.framework
. Learn more in the Adjust iOS SKAdNetwork integration guide.
Install
Dependency Manager
- In your Xcode project, select File > Add Packages… > Add Package Dependency
- Enter the repository URL:
https://github.com/tealium/tealium-ios-adjust-remote-command
- Configure the version rules. Typically,
Up to next major
is recommended. If the currentTealiumAdjust
version does not appear in the list, then reset your Swift package cache. - Select the
TealiumAdjust
module to install, and select the app target you want the module to be installed in. - If you are using any additional modules from the Tealium Swift library, follow the Swift Package Manager instructions to add them.
If your project has more than one app target and needs TealiumAdjust
module in more app targets, you have to manually add them in the Frameworks, Libraries, and Embedded Content section.
To install TealiumAdjust
in additional app targets:
- Select your Xcode project in the Project Navigator.
- In your Xcode project, select the app target under the TARGETS section.
- Navigate to General > Frameworks, Libraries & Embedded Content and select the
TealiumAdjust
module to add it to your app target.
-
Remove
pod "tealium-swift"
andpod "Adjust"
if they exist in your Podfile. The dependency fortealium-swift
is already included in theTealiumAdjust
framework. -
Add the following dependency to your Podfile:
pod "TealiumAdjust"
The
TealiumAdjust
pod includes the followingTealiumSwift
dependencies:"tealium-swift/Core" "tealium-swift/RemoteCommands"
-
Include a dispatcher pod in your installation, either
tealium-swift/Collect
ortealium-swift/TagManagement
, and include any other individual sub modules in your podfile. For example:pod "TealiumAdjust" pod "tealium-swift/Collect" pod "tealium-swift/Lifecycle" pod "tealium-swift/Attribution"
-
Import the modules
TealiumSwift
andTealiumAdjust
in yourTealiumHelper
file, and any other files that access theTealium
class, or the Adjsut remote command.
-
Remove
tealium-swift
from your Cartfile. The dependency fortealium-swift
is already included in theTealiumAdjust
framework. -
Remove the following line if it exists in your Cartfile:
github "adjust/ios_sdk"
-
Add the following dependency to your Cartfile:
github "tealium/tealium-ios-adjust-remote-command"
-
Install Tealium for Android (Kotlin) or Tealium for Android (Java) and add the Tealium Maven URL to your project’s top-level
build.gradle
file, if you haven’t done so already.allprojects { repositories { mavenCentral() maven { url "https://maven.tealiumiq.com/android/releases/" } } }
-
Import both the Adjust SDK and Tealium-Adjust remote commands by adding the following dependencies in your app project’s
build.gradle
file:dependencies { implementation 'com.tealium.remotecommands:adjust:1.0.0' }
-
Navigate to the root of your React Native project.
-
Download and install the
tealium-react-adjust
package with the following command:yarn add tealium-react-adjust
-
React Native Autolinking is enabled in version 1.0.7 of the NPM package and is no longer needed to run
react-native link
if using version 0.60+ of React Native.
Manual Installation
The manual installation for Adjust remote commands requires the Tealium for Swift library to be installed. To install the Adjust remote commands for your iOS project:
-
Install the Adjust SDK, if you haven’t already done so.
-
Clone the Tealium iOS Adjust remote command repo and drag the files within the
Sources
folder into your project. -
Set the
remoteAPIEnabled
configuration flag totrue
The manual installation for Adjust remote commands requires Tealium for Android (Kotlin) or Tealium for Android (Java) to be installed. To install the Adjust remote commands for your Android project:
-
Add
flatDir
to your project rootbuild.gradle
file:allprojects { repositories { mavenCentral() flatDir { dirs 'libs' } } }
-
Add
tealium-adjust.aar
to<PROJECT_ROOT>/<MODULE>/libs
. -
Add the Tealium library dependency to your
build.gradle
file:dependencies { implementation(name:'tealium-adjust', ext:'aar') }
Initialize
For all Tealium libraries, register the Adjust Remote Command when you initialize.
Initialize remote commands with a JSON configuration file or the Remote Command tag for Tealium’s iOS (Swift) library:
var tealium : Tealium?
let config = TealiumConfig(account: "ACCOUNT",
profile: "PROFILE",
environment: "ENVIRONMENT",
dataSource: "DATASOURCE")
config.dispatchers = [Dispatchers.TagManagement, Dispatchers.RemoteCommands]
config.remoteAPIEnabled = true // Required to use Remote Commands
tealium = Tealium(config: config) { _ in
guard let remoteCommands = self.tealium?.remoteCommands else {
return
}
// Webview Tag
let adjust = AdjustRemoteCommand()
// Local JSON
//let adjust = AdjustRemoteCommand(type: .local(file: "adjust"))
// Remote JSON
//let adjust = AdjustRemoteCommand(type: .remote(url: "https://some.domain.com/adjust.json"))
remoteCommands.add(adjust)
}
Initialize remote commands with a JSON configuration file or the Remote Command tag for Tealium’s Android (Kotlin) library:
val config = TealiumConfig(application,
"ACCOUNT",
"PROFILE",
Environment.DEV,
dispatchers = mutableSetOf(Dispatchers.RemoteCommands, Dispatchers.TagManagement));
val adjust = AdjustRemoteCommand(application);
var tealium = Tealium.create(TEALIUM_MAIN, config) {
// Webview Tag
remoteCommands?.add(adjust);
// Local JSON
//remoteCommands?.add(adjust, filename = "adjust.json");
// Remote JSON
//remoteCommands?.add(adjust, remoteUrl = "https://some.domain.com/adjust.json");
}
Initialize remote commands with a JSON configuration file or the Remote Command tag for Tealium’s Android (Java) library:
Tealium.Config config = Tealium.Config.create(application, "ACCOUNT", "PROFILE", "ENVIRONMENT");
Tealium teal = Tealium.createInstance(TEALIUM_MAIN, config);
// New code to add the Adjust Remote Command
AdjustRemoteCommand adjustRemoteCommand = new AdjustRemoteCommand(application)
teal.addRemoteCommand(adjustRemoteCommand);
Initialize remote commands with a JSON configuration file or the Remote Command tag for React Native:
import AdjustRemoteCommand from 'tealium-react-adjust';
// Webview Tag
let adjust = { id: AdjustRemoteCommand.name }
// Local JSON
//let adjust = { id: AdjustRemoteCommand.name, path: "adjust.json" }
// Remote JSON
//let adjust = { id: AdjustRemoteCommand.name, url: "https://some.domain.com/adjust.json" }
let config = TealiumConfig {
// ...
remoteCommands: [adjust]
}
JSON Template
If you are configuring remote commands using a JSON configuration file, refer to the following template to get started. The template includes common mappings used in a standard e-commerce installation. Edit the mappings as needed.
{
"config": {
"api_token": "YOUR_API_TOKEN",
"sandbox": true,
"settings": {
"log_level": "verbose",
"delay_start": 1.0,
"allow_iad": true,
"allow_ad_services": true,
"allow_idfa": true,
"app_secret" : "secret123",
"app_secret_info_1" : "123",
"app_secret_info_2" : "456",
"app_secret_info_3" : "789",
"app_secret_info_4" : "012",
"event_buffering_enabled": false,
"send_in_background": true
}
},
"mappings": {
"event_token": "event_token",
"order_total": "revenue,callback.orderTotal",
"order_currency": "currency",
"order_id": "order_id,callback.orderId",
"conversion_value": "conversion_value",
"sales_region": "sales_region",
"callback_id": "callback_id",
"ad_revenue_source": "ad_revenue_source",
"campaign": "ad_revenue_payload.campaignId",
"ad_uuid": "ad_revenue_payload.adId",
"appstore_receipt_data": "receipt",
"purchase_timestamp": "purchase_time",
"product_sku": "sku",
"purchase_signature": "signature",
"purchase_token": "purchase_token",
"deeplink_url": "deeplink_open_url",
"push_token": "push_token",
"favorite_color": "callback.color,session_callback.color",
"num_of_pets": "partner.pets,session_partner.pets",
"customer_id": "callback.customerId",
"customer_is_member": "partner.isMember",
"session_params": "session_callback,session_partner",
"remove_session_params": "remove_session_callback_params,remove_session_partner_params",
"reset_session_params": "reset_session_callback_params,reset_session_partner_params",
"consent_granted": "measurement_consent",
"enabled": "enabled"
},
"commands": {
"launch": "initialize",
"track_deeplink": "appwillopenurl",
"purchase": "trackevent,updateconversionvalue",
"event": "trackevent",
"contact": "trackevent,addsessioncallbackparams,addsessionpartnerparams",
"ad_revenue": "trackadrevenue",
"subscribe": "trackevent,tracksubscription",
"received_push_token": "setpushtoken",
"add_session_parameters": "addsessioncallbackparams,addsessionpartnerparams",
"remove_session_parameters": "removesessioncallbackparams,removesessionpartnerparams",
"reset_session_parameters": "resetsessioncallbackparams,resetsessionpartnerparams",
"consent_revoked": "gdprforgetme,trackmeasurementconsent",
"consent_granted": "trackmeasurementconsent",
"set_enabled": "setenabled",
"offline": "setofflinemode"
}
}
Supported Methods
We map a command to each Adjust method. To trigger an Adjust method, pass the corresponding command in the specified format.
Remote Command | Adjust Method |
---|---|
initialize |
initialize() |
sendEvent |
trackEvent() |
trackSubscription |
trackSubscription() |
requestTrackingAuthorization * |
requestTrackingAuthorization() |
updateConversionValue * |
updateConversionValue() |
appWillOpen |
appWillOpen() |
trackAdRevenue |
trackAdRevenue() |
setPushToken |
setPushToken() |
setEnabled |
setEnabled() |
setOfflineMode |
setOfflineMode() |
gdprForgetMe |
gdprForgetMe() |
trackThirdPartySharing |
trackThirdPartySharing() |
trackMeasurementConsent |
trackMeasurementConsent() |
addSessionCallbackParams |
addSessionCallbackParams() |
removeSessionCallbackParams |
removeSessionCallbackParams() |
resetSessionCallbackParams |
resetSessionCallbackParams() |
addSessionPartnerParams |
addSessionPartnerParams() |
removeSessionPartnerParams |
removeSessionPartnerParams() |
resetSessionPartnerParams |
resetSessionPartnerParams() |
Only supported in iOS as part of the AppTrackingTransparency.framework
. Learn more in the Adjust iOS SKAdNetwork integration guide.
SDK Setup
Initialize
The Adjust SDK is initialized automatically upon launch. The Adjust API key is set in the tag configuration.
Remote Command | Adjust Method |
---|---|
initialize |
initialize() |
Adjust Developer Guide: Initial SDK Setup
There are several configuration options available in the Adjust Remote Command tag. If any of the below are set on launch, they are sent during the initialize()
method.
Configuration Options
Name | iQ variable mapping | Type |
---|---|---|
environment |
sandbox |
Bool |
logLevel |
logLevel |
String |
delayStart |
delay_start |
Double |
allowiAdInfoReading * |
allow_iad |
Bool |
allowAdServicesInfoReading * |
allow_ad_services |
Bool |
allowIdfaReading * |
allow_idfa |
Bool |
appSecret |
app_secret |
String |
appSecretInfo1 |
app_secret_info_1 |
String |
appSecretInfo2 |
app_secret_info_2 |
String |
appSecretInfo3 |
app_secret_info_3 |
String |
appSecretInfo4 |
app_secret_info_4 |
String |
defaultTracker |
default_tracker |
String |
externalDeviceId |
external_device_id |
String |
eventBufferingEnabled |
event_buffering_enabled |
String |
sendInBackground |
send_in_background |
String |
setPreinstallTrackingEnabled ** |
preinstall_tracking |
String |
iOS and Android only
Track Event
Remote Command | Adjust Method |
---|---|
sendevent |
trackEvent() |
Parameter | Type |
---|---|
event_token (required) |
String |
order_id |
String |
revenue |
Double |
currency |
String |
callback |
Dictionary or Map |
partner |
Dictionary or Map |
callback_id |
String |
Adjust Developer Guide: Track Events
Track Subscription
Remote Command | Adjust Method |
---|---|
tracksubscription |
trackSubscription() |
Parameter | Type |
---|---|
revenue (required) |
Double |
currency (required) |
String |
order_id (required) |
String |
receipt (required for iOS only) |
Data |
sku (required for Android only) |
String |
signature (required for Android only) |
String |
purchase_token (required for Android only) |
String |
purchase_time |
Date |
sales_region |
String |
callback |
Dictionary or Map |
partner |
Dictionary or Map |
Adjust API Reference: Subscription Tracking
Request Tracking Authorization (iOS)
The Adjust SDK automatically requests tracking authorization from the user. To set a completion use the Adjust.trackingAuthorizationCompletion()
method and then add the remote command.
Example:
tealium = Tealium(config: config) { _ in
guard let remoteCommands = self.tealium?.remoteCommands else {
return
}
let adjustRemoteCommand = AdjustRemoteCommand()
adjustRemoteCommand.trackingAuthorizationCompletion = { status in
switch status {
case 0: print("ATTrackingManagerAuthorizationStatusNotDetermined")
case 1: print("ATTrackingManagerAuthorizationStatusRestricted")
case 2: print("ATTrackingManagerAuthorizationStatusDenied")
case 3: print("ATTrackingManagerAuthorizationStatusAuthorized")
default:
break;
}
}
remoteCommands.add(adjustRemoteCommand)
}
Adjust API Reference: App-tracking Authorization Wrapper
Update Conversion Value (iOS Only)
Remote Command | Adjust Method |
---|---|
updateconversionvalue |
updateConversionValue() |
Parameter | Type |
---|---|
conversion_value (required) |
Int |
Adjust API Reference: Update SKAdNetwork Conversion Value
App Will Open
Remote Command | Adjust Method |
---|---|
appwillopen |
appWillOpen() |
Parameter | Type |
---|---|
deeplink_open_url (required) |
String |
ADjust API Reference: Reattribution Via Deep Links
Track Ad Revenue
Remote Command | Adjust Method |
---|---|
trackadrevenue |
trackAdRevenue() |
Parameter | Type |
---|---|
ad_revenue_source (required) |
String |
ad_revenue_payload (required) |
Dictionary or Map |
Adjust API Reference: Ad Revenue Tracking
Set Push Token
Remote Command | Adjust Method |
---|---|
setpushtoken |
setPushToken() |
Parameter | Type |
---|---|
push_token (required) |
String |
Adjust Additional APIs: Set Push Token
Set Offline Mode
Remote Command | Adjust Method |
---|---|
setofflinemode |
setOfflineMode() |
Parameter | Type |
---|---|
offline (required) |
Bool |
Adjust Additional APIs: Set Offline Mode
Callback Parameters
Adjust Additional APIs: Callback Parameters
Add Session Callback Parameters
Remote Command | Adjust Method |
---|---|
addsessioncallbackparams |
addSessionCallbackParams() |
Parameter | Type |
---|---|
session_callback (required) |
Dicationary or Map |
Add Session Partner Parameters
Remote Command | Adjust Method |
---|---|
addsessionpartnerparams |
addSessionPartnerParams() |
Parameter | Type |
---|---|
session_partner (required) |
Dicationary or Map |
Remove Session Callback Parameters
Remote Command | Adjust Method |
---|---|
removesessioncallbackparams |
removeSessionCallbackParams() |
Parameter | Type |
---|---|
remove_session_callback_params (required) |
[String] |
Remove Session Partner Parameters
Remote Command | Adjust Method |
---|---|
removesessionpartnerparams |
removeSessionPartnerParams() |
Parameter | Type |
---|---|
remove_session_partner_params (required) |
[String] |
Reset Session Callback Parameters
Remote Command | Adjust Method |
---|---|
resetsessioncallbackparams |
resetSessionCallbackParams() |
Reset Session Partner Parameters
Remote Command | Adjust Method |
---|---|
resetsessionpartnerparams |
resetSessionPartnerParams() |
Consent Options
Forget Me
Remote Command | Adjust Method |
---|---|
gdprforgetme |
gdprForgetMe() |
Adjust Additional APIs: GDPR Right to be Forgotten
Set Enabled
Remote Command | Adjust Property |
---|---|
setenabled |
setEnabled() |
Parameter | Type |
---|---|
enabled (required) |
Bool |
Adjust API Reference: Disable Tracking
Track Measurement Consent
Remote Command | Adjust Method |
---|---|
trackmeasurementconsent |
trackMeasurementConsent() |
Parameter | Type |
---|---|
measurement_consent (required) |
Bool |
Adjust Additional APIs: Consent Measurement
Track Third Party Sharing
Remote Command | Adjust Method |
---|---|
trackthirdpartysharing |
trackThirdPartySharing() |
Parameter | Type |
---|---|
enabled (required) |
Bool |
Adjust Additional APIs: Enable Third Party Sharing
This page was last updated: February 8, 2024