This is a step-by-step guide to help you integrate and configure the Adjust Extension in your Adobe Experience app for Android. With this extension, you can seamlessly integrate Adjust with the Adobe Experience SDK to capture and send attribution data and in-app event information.
This extension enables you to send installs, sessions, custom in-app events, and other types of data to Adjust. Follow this guide to set up and configure the Adjust Extension and verify that you can send install information to Adjust.
Set up your project
Follow these steps to set up your project to support the Adjust Extension for Adobe Experience SDK.
Install the Adjust Extension
To use the Adjust Extension for Adobe Experience SDK, you need to add it to your project as a dependency. The relevant packages are available on Maven.
Add the following to your build.gradle
file:
com.adjust.adobeextension:adobeextension
-
The Adjust extension for Adobe Experience.
com.adjust.sdk:adjust-android
-
The Adjust Android SDK.
com.android.installreferrer:installreferrer
-
The Android Install Referrer API.
dependencies { implementation 'com.adjust.adobeextension:adobeextension:3.0.0' implementation 'com.adjust.sdk:adjust-android:5.2.0' implementation 'com.adobe.marketing.mobile:core:3.2.0' implementation 'com.android.installreferrer:installreferrer:2.2'}
Add Google Play Services
Apps that target the Google Play Store must use the gps_adid
(Google Advertising ID) to identify devices. To access the gps_adid
, add the play-services-ads-identifier
AAR to your project.
If you’re using Maven, add the com.google.android.gms:play-services-ads-identifier
implementation to your build.gradle
file.
dependencies { implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'}
Configure permissions
The Adjust Extension for Adobe Experience SDK bundles all required permissions by default. You don’t need to add any permissions for the extension to work.
If your app needs to be COPPA (Children’s Online Privacy Protection Act) compliant or you don’t target the Google Play Store, you MUST remove the com.google.android.gms.permission.AD_ID
permission using a remove
directive in your AndroidManifest.xml
file.
<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove"/>
Integration guide
Once you’ve completed the project setup steps, you can integrate the Adjust SDK. The following guide shows you how to:
- Add the Adjust Extension to your Adobe Experience app.
- Set your logging level to verbose to retrieve as much detail as possible from the extension.
- Test the Extension in sandbox mode to ensure it sends data to Adjust.
- Enable your app to open deep links.
- Register with the Adobe Experience SDK.
To do this, you need to create two files:
MainApp.java
: you’ll configure and register the Adjust SDK in this file.MainActivity.java
: you’ll configure deep link handling in this file.
Import classes
First, you need to import some classes into your application files. Import the following classes into your MainApp.java
file:
android.app.Application
-
Used to create the main application.
android.util.Log
-
Used to output logs.
com.adjust.adobeextension.AdjustAdobeExtension
-
Used to register the Adjust Extension.
com.adjust.adobeextension.AdjustAdobeExtensionConfig
-
Used to configure the Adjust Extension.
com.adobe.marketing.mobile.AdobeCallback
-
Used when registering your extensions.
com.adobe.marketing.mobile.Extension
-
Used to build a list of extensions.
com.adobe.marketing.mobile.Analytics
-
Used to enable analytics in the Adobe Experience SDK.
com.adobe.marketing.mobile.Identity
-
Used to manage user identities in the Adobe Experience SDK
com.adobe.marketing.mobile.LoggingMode
-
Used to configure logging in the Adobe Experience SDK.
com.adobe.marketing.mobile.MobileCore
-
Used to communicate with the Adobe Experience SDK.
import android.app.Application;import android.util.Log;
import com.adjust.adobeextension.AdjustAdobeExtension;import com.adjust.adobeextension.AdjustAdobeExtensionConfig;import com.adobe.marketing.mobile.AdobeCallback;import com.adobe.marketing.mobile.Extension;import com.adobe.marketing.mobile.Analytics;import com.adobe.marketing.mobile.Identity;import com.adobe.marketing.mobile.LoggingMode;import com.adobe.marketing.mobile.MobileCore;
Import the following classes into your MainActivity.java
file:
android.content.Intent
-
Used to get the operation intent from Android.
android.net.Uri
-
Used to type deep links.
android.os.Bundle
-
Used to type the app’s saved instance state.
android.view.View
-
Used to type your app’s view.
androidx.appcompat.app.AppCompatActivity
-
Used to create your main activity. See the
AppCompatActivity
documentation for reference. com.adjust.sdk.Adjust
-
Used to access Adjust APIs.
com.adjust.sdk.AdjustDeeplink
-
Used to create Adjust deep links.
import android.content.Intent;import android.net.Uri;import android.os.Bundle;import android.view.View;
import androidx.appcompat.app.AppCompatActivity;
import com.adjust.sdk.Adjust;import com.adjust.sdk.AdjustDeeplink;
Create a global application class
The recommended way to register the Adjust Android Extension for Adobe Experience SDK is to use a global Android Application class. If you’ve not yet created an Application, follow these steps:
- Create a new class that extends
Application
in yourMainApp.java
file.
public class MainApp extends Application {}
-
Open your
AndroidManifest.xml
and find the<application>
element. -
Add the name of your new class as an
android:name
attribute. In this example, the newApplication
class is namedMainApp
.<application android:name=".MainApp"></application> -
Within your
Application
class, find or add theonCreate
method.
public class MainApp extends Application { @Override public void onCreate() { super.onCreate(); }}
Configure the Adjust Extension
Once you’ve created the Application
class and called onCreate
, follow these steps to configure the Adjust Android Extension for Adobe Experience SDK:
- Inside your
onCreate
function, callMobileCore.setApplication(this)
to register the application context.
public void onCreate() { super.onCreate();
MobileCore.setApplication(this);}
- Set your logging level by calling the
MobileCore.setLogLevel
method with the following argument:
logLevel
:String
- The level of logging you want to enable.
LoggingMode.VERBOSE
: enable all logging.LoggingMode.DEBUG
: disable verbose logging.LoggingMode.WARNING
: log only errors and warnings.LoggingMode.ERROR
: log only errors.
public void onCreate() { super.onCreate();
MobileCore.setApplication(this); MobileCore.setLogLevel(LoggingMode.VERBOSE);}
- Create a new
try...catch
block to configure the Adjust Extension:
public void onCreate() { super.onCreate();
MobileCore.setApplication(this); MobileCore.setLogLevel(LoggingMode.VERBOSE);
try { } catch (Exception e) { Log.e("example", "Exception occurred during configuration: " + e.getMessage()); }}
- Within your
try
block, callMobileCore.configureWithAppID
and pass your Adobe app ID.
try { MobileCore.configureWithAppID("your_adobe_app_id");} catch (Exception e) { Log.e("example", "Exception occurred during configuration: " + e.getMessage());}
- Within your
try
block, create a new instance ofAdjustAdobeExtensionConfig
with the following argument:
environment
:String
- The environment in which your device is running.
- Pass
AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX
when testing. - Pass
AdjustAdobeExtensionConfig.ENVIRONMENT_PRODUCTION
when running the app in production.
- Pass
try { MobileCore.configureWithAppID("your_adobe_app_id");
AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX);} catch (Exception e) { Log.e("example", "Exception occurred during configuration: " + e.getMessage());}
- Call
AdjustAdobeExtension.setConfiguration
with yourAdjustAdobeExtensionConfig
instance as an argument.
try { MobileCore.configureWithAppID("your_adobe_app_id");
AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX); AdjustAdobeExtension.setConfiguration(config);} catch (Exception e) { Log.e("example", "Exception occurred during configuration: " + e.getMessage());}
Register the Adjust Extension
Once you’ve configured the Adjust Extension, you need to register it with the Adobe Experience SDK. To do this:
- Create a new
try...catch
block below your configuration block.
public class MainApp extends Application { @Override public void onCreate() { super.onCreate();
MobileCore.setApplication(this); MobileCore.setLogLevel(LoggingMode.VERBOSE);
try { MobileCore.configureWithAppID("your_adobe_app_id");
AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX); AdjustAdobeExtension.setConfiguration(config); } catch (Exception e) { Log.e("example", "Exception occurred during configuration: " + e.getMessage()); }
try { } catch (Exception e) { Log.e("example", "Exception occurred while registering Extension: " + e.getMessage()); } }}
- Within your
try
block, create a new list of the extensions you want to register. The example in this guide imports theAnalytics
andIdentity
extensions in addition to theAdjustAdobeExtension
.
extensions
:List<Class<? extends Extension>>
- Your list of extensions.
try { List<Class<? extends Extension>> extensions = Arrays.asList( Analytics.EXTENSION, Identity.EXTENSION, AdjustAdobeExtension.EXTENSION);} catch (Exception e) { Log.e("example", "Exception occurred while registering Extension: " + e.getMessage());}
- Inside your
try
block, call theMobileCore.registerExtensions
method with your list of extensions and the following callback argument:
completionCallback
:AdobeCallback
- A callback function that fires when registration completes.
try { List<Class<? extends Extension>> extensions = Arrays.asList( Analytics.EXTENSION, Identity.EXTENSION, AdjustAdobeExtension.EXTENSION); MobileCore.registerExtensions(extensions, new AdobeCallback<Object>() { @Override public void call(Object o) { Log.d("example", "Adjust Adobe Extension SDK initialized"); } });} catch (Exception e) { Log.e("example", "Exception occurred while registering Extension: " + e.getMessage());}
Set up your activity file
Next, you need to set up your MainActivity.java
file. You’ll use this file to set up your Adjust features later. For the purposes of this guide, you’re only going to set up the onCreate
function to handle application startup.
- Create a new public class called
MainActivity
. This class should extend theAppCompatActivity
class.
public class MainActivity extends AppCompatActivity {}
- Create a new protected override function called
onCreate
. This function receives thesavedInstanceState
and returnsvoid
.
public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) {}}
- Within your
onCreate
function, callsuper.onCreate
with thesavedInstanceState
to create your activity.
@Overrideprotected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);}
- Next, call
setContentView
to map your activity to your app layout. In this example, the layout file is calledactivity_main.xml
.
@Overrideprotected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);}
Set up deep link handling
To configure the Adjust Android Extension for Adobe Experience SDK to open deep links, follow these steps:
- Create a new
Intent
variable calledintent
inside youronCreate
function and assign it the output ofgetIntent()
.
@Overrideprotected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);
Intent intent = getIntent();}
- Create a new
Uri
variable calleddata
and assign it the output ofintent.getData()
.
@Overrideprotected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);
Intent intent = getIntent(); Uri data = intent.getData();}
- Construct a new
AdjustDeeplink
instance with yourdata
variable.
@Overrideprotected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);
Intent intent = getIntent(); Uri data = intent.getData(); AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data);}
- To open the URL, pass your
AdjustDeeplink
instance andgetApplicationContext()
to theAdjust.processDeeplink
method.
@Overrideprotected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);
Intent intent = getIntent(); Uri data = intent.getData(); AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); Adjust.processDeeplink(adjustDeeplink, getApplicationContext());}
If you use short branded links, you can alternatively use the Adjust.processAndResolveDeeplink
method to resolve your shortened link and return it to a callback function.
@Overrideprotected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);
Intent intent = getIntent(); Uri data = intent.getData(); AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data); Adjust.processAndResolveDeeplink(adjustDeeplink, getApplicationContext(), new OnDeeplinkResolvedListener() { @Override public void onDeeplinkResolved(String s) { Log.d("example", "Unwrapped short link: " + s); } });}
Once you’ve completed these steps, build and run your app. In your log viewer, set the filter tag:Adjust
to show only logs relating to the Adjust Extension. After you launch your app, you should see the message Install tracked
.