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.
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.
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.
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 the following classes into your MainActivity.java
file:
android.content.Intent
Used to get theoperation 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
documentationfor reference.com.adjust.sdk.Adjust
Used to access Adjust APIs.
com.adjust.sdk.AdjustDeeplink
Used to create Adjust deep links.
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.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
.Within your
Application
class, find or add theonCreate
method.
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.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.
Create a new
try...catch
block to configure the Adjust Extension:Within your
try
block, callMobileCore.configureWithAppID
and pass your Adobe app ID.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
Call
AdjustAdobeExtension.setConfiguration
with yourAdjustAdobeExtensionConfig
instance as an argument.
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.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.
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.
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.Create a new protected override function called
onCreate
. This function receives thesavedInstanceState
and returnsvoid
.Within your
onCreate
function, callsuper.onCreate
with thesavedInstanceState
to create your activity.Next, call
setContentView
to map your activity to your app layout. In this example, the layout file is calledactivity_main.xml
.
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()
.Create a new
Uri
variable calleddata
and assign it the output ofintent.getData()
.Construct a new
AdjustDeeplink
instance with yourdata
variable.To open the URL, pass your
AdjustDeeplink
instance andgetApplicationContext()
to theAdjust.processDeeplink
method.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.
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
.