Adjust is an industry-leading mobile attribution provider that allows you to bring all your business data together to get powerful insights from it.
RudderStack allows you to configure your mobile devices with our SDKs to send your customer event data to Adjust - without any hassle. You can check the code for Adjust destination on our GitHub for Android and iOS.
Getting started
Before configuring your source and destination on the RudderStack app, please check whether the platform you are working on is supported by Adjust. Refer to the table below:
Connection Mode | Web | Mobile | Server |
---|---|---|---|
Device mode | - | Supported | - |
Cloud mode | Supported | Supported | Supported |
Once you have confirmed that the platform supports sending events to Adjust, perform the steps below:
- From your RudderStack dashboard, add the source and Adjust as a destination.
Adding device mode integration
Once you add Adjust as a destination in the RudderStack dashboard, follow these steps to add it to your project depending on your integration platform:
- Add the following line to your CocoaPods
Podfile
pod 'Rudder-Adjust' - After adding the dependency, you must register the
RudderAdjustFactory
with yourRudderClient
initialization as afactory
ofRudderConfig
. To do this, run the following command to import theRudderAdjustFactory.h
file in yourAppDelegate.m
file.#import <Rudder-Adjust/RudderAdjustFactory.h> - Then, change the SDK initialization to the following:RudderConfigBuilder *builder = [[RudderConfigBuilder alloc] init];[builder withDataPlaneUrl:DATA_PLANE_URL];[builder withFactory:[RudderAdjustFactory instance]];[RudderClient getInstance:WRITE_KEY config:[builder build]];
- Install
RudderAdjust
(available through CocoaPods) by adding the following line to yourPodfile
:pod 'RudderAdjust', '~> 1.0.0' - Run the
pod install
command. - Next, import the SDK depending on your preferred platform:import RudderAdjust@import RudderAdjust;
- Add the imports to your
AppDelegate
file under thedidFinishLaunchingWithOptions
method, as shown:let config: RSConfig = RSConfig(writeKey: WRITE_KEY).dataPlaneURL(DATA_PLANE_URL)RSClient.sharedInstance().configure(with: config)RSClient.sharedInstance().addDestination(RudderAdjustDestination())RSConfig *config = [[RSConfig alloc] initWithWriteKey:WRITE_KEY];[config dataPlaneURL:DATA_PLANE_URL];[[RSClient sharedInstance] configureWith:config];[[RSClient sharedInstance] addDestination:[[RudderAdjustDestination alloc] init]];
- Add
mavenCentral()
to therepositories
section of yourbuild.gradle
file:repositories {mavenCentral()} - Add the following permissions to your
AndroidManifest.xml
file:<uses-permission android:name="android.permission.INTERNET"/><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>// If you are not targeting the Google Play Store, you need to add the following permission:<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>// If you are targeting Android 13 and above (API level 33), you need to add the com.google.android.gms.AD_ID permission to read the device's advertising ID.<uses-permission android:name="com.google.android.gms.permission.AD_ID"/> - Add the following lines in your
build.gradle
file underdependencies
:// RudderStack Android-SDKimplementation 'com.rudderstack.android.sdk:core:[1.0,2.0)'// RudderStack Adjust-SDKimplementation 'com.rudderstack.android.integration:adjust:1.0.1'// Add Google Play Services library to enable the Google Advertising ID for Adjust SDKimplementation 'com.google.android.gms:play-services-ads-identifier:17.0.1'// To support the Google Play Referrer API, make sure you have the following in your build.gradle file:implementation 'com.android.installreferrer:installreferrer:2.2'For more information on the implementation
com.google.android.gms:play-services-ads-identifier:17.0.1
, refer to this Adjust help guide. - After adding the dependency, register the
RudderAdjustFactory
with yourRudderClient
initialization as afactory
ofRudderConfig
. To do so, add the following line in yourApplication
class:import com.rudderstack.android.integration.adjust.AdjustIntegrationFactory; - Finally, change the SDK initialization to the following:val rudderClient: RudderClient = RudderClient.getInstance(this,WRITE_KEY,RudderConfig.Builder().withDataPlaneUrl(DATA_PLANE_URL).withFactory(AdjustIntegrationFactory.FACTORY).build())
- First, add RudderStack's Unity SDK to your project.Follow the RudderStack Unity SDK guide for more information.
- Once you have added the SDK to your project, download the Adjust SDK extension package from GitHub and import it in your project.The package comes with Adjust Unity SDK embedded in it along with the required
jar
files for Android Install Referrer. It is not recommended to add the Adjust SDK separately. - After importing the
rudder-unity-extension-adjust.unitypackage
to your project, attach theRudderPreferbs.prefab
file fromRudderUnityPlugin
to your mainGameObject
- Finally, change the initialization of the SDK using the following code:// Build your configRudderConfigBuilder configBuilder = new RudderConfigBuilder().WithEndPointUrl(DATA_PLANE_URL).WithFactory(RudderAdjustIntegrationFactory.GetFactory());// Get instance for RudderClientRudderClient rudderClient = RudderClient.GetInstance(WRITE_KEY,configBuilder.Build());
Identify
When you call identify
for tracking user data, RudderStack will call Adjust's addSessionPartnerParameter
method to set anonymousId
and/or userId
so that the value is passed from Adjust to the subsequent calls.
Here is an example:
[[RudderClient sharedInstance] identify:@"developer_user_id" traits:@{@"foo": @"bar", @"foo1": @"bar1"}];
Track
When you make the track
call, RudderStack maps the eventName
with the pre-defined list of custom events from Adjust.
eventToken
to eventName
in the dashboard. If you don't define the mapping Adjust will not accept the event.We add all the properties as callbackParameter
in the Adjust event.
The following snippet is a simple demonstration of the track
call:
[[RudderClient sharedInstance] track:@"test_event" properties:@{@"key":@"value", @"foo": @"bar"}];
For revenue
event, add the fields total
and currency
to properties
and it will be mapped to Adjust's revenue
event.
[[RudderClient sharedInstance] track:@"purchase" properties:@{@"total":@2.99, @"currency": @"USD"}];
Reset
if you call reset
method, RudderStack will call resetSessionCallbackParameters
of the Adjust SDK to reset the user ID as well as the associated traits and properties of that user.
[[RudderClient sharedInstance] reset];
Install attribution
Adjust's native SDK handles install attribution out of the box with RudderStack. For testing Install Attribution as well as troubleshooting tips, please follow this guide.
cloud-mode
Environment and logging
The Adjust environment depends on the RudderLogLevel
. RudderLogLevel.DEBUG
or higher will set the environment to Sandbox
and logLevel
to VERBOSE
. For anything below that, the environment will be set to Production
and logLevel
to ERROR
.
Contact us
For queries on any of the sections covered in this guide, you can contact us or start a conversation in our Slack community.