Edit in GitHubLog an issue

Adobe Target

Adobe Target helps test, personalize, and optimize mobile app experiences based on user behavior and mobile context. You can deliver interactions that engage and convert through iterative testing and rules-based and AI-powered personalization.

To get started with Target, follow these steps:

  1. Configure the Target extension in the Data Collection UI.
  2. Add the Target Extension to your app.
  3. Implement Target APIs to:
    • Request mbox offers.
    • Prefetch mbox offers.
    • Track mboxes.
    • Enter visual preview mode.

Configure the Target extension in the Data Collection UI

Adobe Target Extension Configuration

  1. In the Data Collection UI, select the Extensions tab.
  2. On the Catalog tab, locate the Adobe Target extension, and select Install.
  3. Your Target client code will be detected automatically.
  4. Optionally, provide your Environment ID.
  5. Set the timeout value to at least 5 seconds.
  6. Optionally, enter the Target workspace property token that was generated from Target UI.
  7. Select Save.
  8. Follow the publishing process to update SDK configuration.

Add Target to your app

To add the Target extension to your app:

Java

  1. Add the Mobile Core, Identity and Target extensions to your project using the app's Gradle file.
Copied to your clipboard
implementation platform('com.adobe.marketing.mobile:sdk-bom:2.+')
implementation 'com.adobe.marketing.mobile:core'
implementation 'com.adobe.marketing.mobile:identity'
implementation 'com.adobe.marketing.mobile:target'

Register Target with Mobile Core

To register the Target extension with Mobile Core:

Java

In your Application's onCreate() method, after calling the setApplication() method, register Target with Mobile Core.

Copied to your clipboard
import com.adobe.marketing.mobile.MobileCore;
import com.adobe.marketing.mobile.Target;
import com.adobe.marketing.mobile.Identity;
import com.adobe.marketing.mobile.AdobeCallback;
public class MainApp extends Application {
private final String ENVIRONMENT_FILE_ID = "YOUR_APP_ENVIRONMENT_ID";
@Override
public void onCreate() {
super.onCreate();
MobileCore.setApplication(this);
MobileCore.configureWithAppID(ENVIRONMENT_FILE_ID);
MobileCore.registerExtensions(
Arrays.asList(Target.EXTENSION, Identity.EXTENSION),
o -> Log.d("MainApp", "Adobe Target Mobile SDK was initialized.")
);
}
}

Kotlin

Copied to your clipboard
import com.adobe.marketing.mobile.MobileCore
import com.adobe.marketing.mobile.Target
import com.adobe.marketing.mobile.Identity
import com.adobe.marketing.mobile.AdobeCallback
class MainApp : Application() {
private var ENVIRONMENT_FILE_ID: String = "YOUR_APP_ENVIRONMENT_ID"
override fun onCreate() {
super.onCreate()
MobileCore.setApplication(this)
MobileCore.configureWithAppID(ENVIRONMENT_FILE_ID)
MobileCore.registerExtensions(
listOf(Target.EXTENSION, Identity.EXTENSION)
) {
Log.d("MainApp", "Adobe Target Mobile SDK was initialized")
}
}
}

Parameters in a Target request

Here is some information about the parameters in a Target request:

Target Order class

The TargetOrder class encapsulates the order ID, the order total, and the purchased product IDs. You can instantiate this class to create order parameters.

Java

Syntax

Copied to your clipboard
public TargetOrder(final String id, final double total, final List<String> purchasedProductIds)

Example

Copied to your clipboard
List<String> purchasedProductIds = new ArrayList<String>();
purchasedProductIds.add("34");
purchasedProductIds.add("125");
TargetOrder targetOrder = new TargetOrder("123", 567.89, purchasedProductIds);

Target Product class

The TargetProduct class encapsulates the product ID and the product category ID, and you can instantiate this class to create order parameters.

Java

Syntax

Copied to your clipboard
public TargetProduct(final String id, final String categoryId)

Example

Copied to your clipboard
TargetProduct targetProduct = new TargetProduct("123", "Books");

Target Parameters

TargetParameters encapsulates mboxParameters, profileParameters, orderParameters, and productParameters, and allows you easily pass these parameters in a Target request.

Java

Syntax

Copied to your clipboard
TargetParameters targetParameters = new TargetParameters.Builder()
.parameters(new HashMap<String, String>())
.profileParameters(new HashMap<String, String>())
.product(new TargetProduct("productId", "productCategoryId"))
.order(new TargetOrder("orderId", 0.0, new ArrayList<String>()))
.build();

Example

Copied to your clipboard
List<String> purchasedProductIds = new ArrayList<String>();
purchasedProductIds.add("34");
purchasedProductIds.add("125");
TargetOrder targetOrder = new TargetOrder("123", 567.89, purchasedProductIds);
TargetProduct targetProduct = new TargetProduct("123", "Books");
Map<String, String> mboxParameters = new HashMap<String, String>();
mboxParameters1.put("status", "platinum");
Map<String, String> profileParameters = new HashMap<String, String>();
profileParameters1.put("gender", "male");
TargetParameters targetParameters = new TargetParameters.Builder()
.parameters(mboxParameters)
.profileParameters(profileParameters)
.product(targetProduct)
.order(targetOrder)
.build();

Merge behavior of Target parameters

TargetParameters, such as mboxParameters, profileParameters, orderParameters, and productParameters, can be passed in the Target APIs and can also be passed in when you create TargetPrefetch or TargetRequest objects. The TargetParameters that are passed in the public APIs are global parameters and are merged with the corresponding parameters in the individual TargetRequest or TargetPrefetch objects.

When merging, the new keys in the mbox parameters or the profile parameters are appended to the final dictionary, and the keys with the same name are overwritten in each TargetRequest or TargetPrefetch object by the keys from the global parameters. For TargetOrder or TargetProduct objects, the object that is passed to the global parameters replaces the corresponding object in the TargetRequest or TargetPrefetch objects.

Target sessions

The Target extension supports persistent sessions. When a Target request is received, if a session ID does not exist, a new ID is generated and is sent in the request. This ID, with the Edge Host that is returned from Target, is kept in persistent storage for the configured target.sessionTimeout period. If the timeout value is not configured, the default value is 30 minutes.

If no Target request is received during the configured target.sessionTimeout or if the resetExperience API is called, these variables are reset and removed from persistent storage.

Visual preview

The visual preview mode allows you to easily perform end-to-end QA activities by enrolling and previewing these activities on your device. This mode does not require a specialized testing set up. To get started, set up a URL scheme and generate the preview links. For more information about setting up Target visual preview, see Target mobile preview. For more information about setting URL schemes for iOS, see Defining a Custom URL Scheme for Your App. For more information about setting URL schemes for Android, see Create Deep Links to App Content.

You can also set an application deep link that can be triggered when selections are made in the preview mode by using the setPreviewRestartDeeplink API.

To enter the preview visual mode, use the collectLaunchInfo API to enable the mode and select the red floating button that appears on the app screen. For more information, see collectLaunchInfo.

On Android, when the application is launched as a result of a deep link, the Mobile Core's collectLaunchInfo API is internally invoked, and the Target activity and deep link information is extracted from the Intent extras.

The SDK can only collect information from the launching Activity if setApplication has been called. Setting the Application is only necessary on an Activity that is also an entry point for your application. However, setting the Application on each Activity has no negative impact and ensures that the SDK always has the necessary reference to your Application. We recommend that you call setApplication API in each of your Activities.

Offer Prefetch

The SDK can minimize the number of times it reaches out to Target servers to fetch offers by caching server responses. With a successful prefetch call for mbox locations, offer content is retrieved and cached in the SDK. This content is retrieved from the cache for all future retrieveLocationContent API calls for the specified mbox names. This prefetch process reduces the offer load time and network calls that were made to the Target servers, and the process allows Target to be notified which mbox was visited by the mobile app user.

Target with Analytics (A4T)

To track the performance of your Target activities for certain segments, set up the Analytics for Target (A4T) cross-solution integration by enabling the A4T campaigns. This integration allows you to use Analytics reports to examine your results. If you use Analytics as the reporting source for an activity, all reporting and segmentation for that activity is based on Analytics data collection. For more information, see Adobe Analytics for Adobe Target (A4T).

Once Analytics is listed as the reporting source for an activity on Target UI, A4T works out of the box in the Target SDK. The Target SDK extension extracts the A4T payload from the Target server response, dispatches an event for Analytics SDK extension to send an internal track action request to the configured Analytics server.

The A4T payload returned from Target servers is sent to Adobe Analytics in the following cases:

Configuration keys

To programmatically update SDK configuration, use the following information to change your Target configuration values:

For more information, see Programmatic updates to Configuration.

KeyDescriptionData Type
target.clientCode
Client code for your account.
String
target.timeout
Time, in seconds, to wait for a response from Target servers before timing out.
Integer
target.environmentId
Environment ID you want to use. If the value is left blank, the default production environment will be used.
Integer
target.propertyToken
at_property token value, which is generated from the Target UI. If this value is left blank, no token is sent in the Target network calls.
String
target.previewEnabled
Boolean parameter, which can be used to enable/disable Target Preview. If not specified, then Preview will be enabled by default.
Boolean
target.sessionTimeout
The duration, in seconds, during which the Target session ID and Edge Host are persisted. If this value is not specified, the default timeout value is 30 minutes.
Integer
target.server
Optional. If provided, all Target requests will be sent to this host. e.g. - mytargetdomain.com
String
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.