adjust-icon

Android Adobe Extension v3 migration guide

The Adjust Extension for Adobe Experience SDK has been updated to v3 to support Adjust Android SDK v5. Follow this guide to migrate from v2 to v3.

To install v3 of the Adjust Android Extension for Adobe Experience, update the dependency declarations in your build.gradle as follows:

  1. com.adjust.adobeextension:adobeextension MUST be updated to 3.0.0 or later.
  2. com.adjust.sdk:adjust-android MUST be updated to 5.0.0 or later.
dependencies {
implementation 'com.adjust.adobeextension:adobeextension:3.0.0'
implementation 'com.adjust.sdk:adjust-android:5.0.2'
implementation 'com.adobe.marketing.mobile:core:3.2.0'
implementation 'com.android.installreferrer:installreferrer:2.2'
}

For a complete guide to setting up the Adjust Android Extension for Adobe Experience, see the integration guide.

New APIs

于 v3 中添加

The following APIs have been added in v3.

v3 of the Adjust Extension for Adobe Experience SDK adds support for resolving short branded links. To resolve shortened links, call the Adjust.processAndResolveDeeplink method with the following arguments:

adjustDeeplink: AdjustDeeplink

The deep link that opened the app.

context: Context

The app context. CallgetApplicationContext()to fill this value.

callback: OnDeeplinkResolvedListener

A callback function that receives the resolved short link as an argument.

Intent intent = getIntent();
Uri data = intent.getData();
AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data);
Adjust.processAndResolveDeeplink(adjustDeeplink, getApplicationContext(), new OnDeeplinkResolvedListener() {
@Override
public void onDeeplinkResolved(String s) {
}
});

Global callback parameters

v3 of the Adjust Extension for Adobe Experience SDK adds support for the global callback parameters API from Android SDK v5. To add global callbacks to your sessions, call the Adjust.addGlobalCallbackParameter method with the following arguments:

key: String

The key of your parameter.

value: String

The value of your parameter.

Adjust.addGlobalCallbackParameter("key", "value");
Adjust.addGlobalCallbackParameter("user_id", "855");

Learn how to set up global callback.

Global partner parameters

v3 of the Adjust Extension for Adobe Experience SDK adds support for the global partner parameters API from Android SDK v5. To add global partner parameters, call the Adjust.addGlobalPartnerParameter method with the following arguments:

key: String

The key of your parameter.

value: String

The value of your parameter.

Adjust.addGlobalPartnerParameter("key", "value");
Adjust.addGlobalPartnerParameter("user_id", "855");

Learn how to set up global partner parameters.

Set external device ID

v3 of the Adjust Extension for Adobe Experience SDK adds support for setting external device identifiers. To set an external device ID, call the setExternalDeviceId method of your AdjustAdobeExtensionConfig instance with the following argument:

externalDeviceId: String

Your external device identifier.

String environment = AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX;
AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment);
config.setExternalDeviceId("{YourExternalDeviceId}");
AdjustAdobeExtension.setConfiguration(config);

Learn how to configure external device IDs.

v3 of the Adjust Extension for Adobe Experience SDK adds support for setting a default link token for recording preinstalled app installs to a default campaign. To set a default link token, call the setDefaultTracker method of your AdjustAdobeExtensionConfig instance with the following argument:

defaultTracker: String

The alphanumeric link token of your preinstall campaign.

String environment = AdjustAdobeExtensionConfig.ENVIRONMENT_SANDBOX;
AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment);
config.setDefaultTracker("{Token}");
AdjustAdobeExtension.setConfiguration(config);

Learn how to send preinstalled app activity.

Changed APIs

于 v3 中变更

The following APIs have changed in v3.

Retrieve device ADID

In SDK v2, the AdjustAttribution class has a property called adid. This property has been removed. You can retrieve the device's ADID asynchronously, by calling Adjust.getAdid.

Adjust.getAdid(new OnAdidReadListener() {
@Override
public void onAdidRead(String adid) {
// Your callback function
}
});

Direct deep linking

In SDK v2, you can open deep links for attribution by calling the AdjustAdobeExtension.openUrl method with the deep link data as an argument.

Intent intent = getIntent();
Uri data = intent.getData();
AdjustAdobeExtension.openUrl(data, getApplicationContext());

SDK v3 has been updated to use the Adjust Android SDK's processDeeplink method. To open direct deep links:

  1. Create a new AdjustDeeplink instance with the deep link URL.
  2. Pass your AdjustDeeplink instance to the Adjust.processDeeplink method.
Intent intent = getIntent();
Uri data = intent.getData();
AdjustDeeplink adjustDeeplink = new AdjustDeeplink(data);
Adjust.processDeeplink(adjustDeeplink, getApplicationContext());

Learn how to reattribute users with direct deep links.

Deferred deep linking callback

In SDK v2, you can configure the SDK to launch a callback function when a deferred deep link is opened by passing a function to the setOnDeeplinkResponseListener method of your AdjustAdobeExtensionConfig instance.

AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment);
config.setOnDeeplinkResponseListener(new OnDeeplinkResponseListener() {
@Override
public boolean launchReceivedDeeplink(Uri deeplink) {
if (shouldAdjustSdkLaunchTheDeeplink(deeplink)) {
return true;
} else {
return false;
}
}
});
AdjustAdobeExtension.setConfiguration(config);

In SDK v3, the setOnDeeplinkResponseListener method has been renamed to setOnDeferredDeeplinkResponseListener.

AdjustAdobeExtensionConfig config = new AdjustAdobeExtensionConfig(environment);
config.setOnDeferredDeeplinkResponseListener(new OnDeferredDeeplinkResponseListener() {
@Override
public boolean launchReceivedDeeplink(Uri deeplink) {
if (shouldAdjustSdkLaunchTheDeeplink(deeplink)) {
return true;
} else {
return false;
}
}
});
AdjustAdobeExtension.setConfiguration(config);

Learn how to work with deferred deep link callbacks.