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 as well as rules-based and AI-powered personalization.
To get started with Target, follow these steps:
- Configure the Target Extension in Launch
- Add the Target Extension to your app
- Implement Target APIs to:
- Request activities
- Prefetch offers
- Enter visual preview mode
- In Launch, click the Extensions tab.
- On the Installed tab, locate the Adobe Target extension and click Configure.
- Provide your Target client code.
- Optionally, provide your Environment ID.
- Provide a timeout value.
- Click Save.
- Follow the publishing process, to update SDK configuration
{% tabs %} {% tab title="Android" %}
-
Add the Target extension to your project using the app's Gradle file.
-
Import the Target extension in your application's main activity.
import com.adobe.marketing.mobile.*;
{% endtab %}
{% tab title="iOS" %}
-
Add the Target library to your project via your
Podfile
by addingpod 'ACPTarget'
-
Import the Target and Identity library.
#import <ACPCore_iOS/ACPCore_iOS.h> #import <ACPTarget_iOS/ACPTarget_iOS.h> #import <ACPIdentity_iOS/ACPIdentity_iOS.h>
Update the bridging header {% endtab %} {% endtabs %}
{% tabs %} {% tab title="Android" %}
You may do the following after calling the setApplication()
method in the onCreate()
method. Here is code sample which calls these setup methods:
public class TargetApp extends Application {
@Override
public void onCreate() {
super.onCreate();
MobileCore.setApplication(this);
try {
Target.registerExtension();
Identity.registerExtension();
} catch (Exception e) {
//Log the exception
}
}
}
{% endtab %}
{% tab title="iOS" %}
- In your app's
didFinishLaunchingWithOptions
function register the Target extension
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[ACPIdentity registerExtension];
[ACPTarget registerExtension];
// Override point for customization after application launch.
return YES;
}
{% endtab %} {% endtabs %}
The SDK can minimize the number of times it reaches out to Target servers in order to fetch offers by caching server responses. When this feature is enabled, offer content will be retrieved and cached during the prefetch call. This content will be retrieved from the cache for all future calls that contain cached content for the specified mbox name. This "prefetch" process reduces offer load time, network calls made to Target servers, and even provides for Target to be notified which mbox was visited by the mobile app user.
{% hint style="warning" %} Prefetched offer content does not persist across launches. The prefetch content is cached as long as the application lives or until the API to clear cache is called. {% endhint %}
{% tabs %} {% tab title="Android" %}
TargetPrefetch
builder helps to create a TargetPrefetch
instance with the specified data. The returned instance can be used with prefetchContent
, which accepts a TargetPrefetch
object list to prefetch offers for the specified mbox locations.
TargetPrefetch prefetchRequest = new TargetPrefetch.Builder("mboxName")
.setMboxParameters(new HashMap<String, String>())
.setOrderParameters(new HashMap<String, Object>())
.setProductParameters(new HashMap<String, String>())
.build();
Sends a prefetch request to your configured Target server with the TargetPrefetch
list and specified profileParameters
. The callback will be invoked when the prefetch is complete, which returns a success status for the prefetch request.
public static void prefetchContent(final List<TargetPrefetch> targetPrefetchList,
final Map<String, Object> profileParameters,
final AdobeCallback<Boolean> callback);
// first prefetch request
Map<String, Object> mboxParameters1 = new HashMap<>();
mboxParameters1.put("status", "platinum");
// second prefetch request
Map<String, Object> mboxParameters2 = new HashMap<>();
mboxParameters2.put("userType", "paid");
List<String> purchasedIds = new ArrayList<String>();
purchasedIds.add("34");
purchasedIds.add("125");
Map<String, Object> orderParameters2 = new HashMap<>();
orderParameters2.put("id", "ADCKKIM");
orderParameters2.put("total", "344.30");
orderParameters2.put("purchasedProductIds", purchasedIds);
Map<String, Object> productParameters2 = new HashMap<>();
productParameters2.put("id", "24D3412");
productParameters2.put("categoryId","Books");
TargetPrefetch prefetchRequest1 = new TargetPrefetch.Builder("mboxName1")
.setMboxParameters(mboxParameters1)
.build();
TargetPrefetch prefetchRequest2 = new TargetPrefetch.Builder("mboxName2")
.setMboxParameters(mboxParameters2)
.setOrderParameters(orderParameters2)
.setProductParameters(productParameters2)
.build();
List<TargetPrefetchObject> prefetchMboxesList = new ArrayList<>();
prefetchMboxesList.add(prefetchRequest1);
prefetchMboxesList.add(prefetchRequest2);
// Call the prefetchContent API.
Target.prefetchContent(prefetchMboxesList, profileParameters, prefetchStatusCallback);
{% endtab %}
{% tab title="iOS" %}
Use prefetchContent
to send a prefetch request to your configured Target server with the ACPTargetPrefetchObject
array and specified profileParameters
. The callback will be invoked when the prefetch is complete, which returns a success status for the prefetch request.
+ (void) prefetchContent: (nonnull NSArray<ACPTargetPrefetchObject*>*) targetPrefetchObjectArray
withProfileParameters: (nullable NSDictionary<NSString*, NSString*>*) profileParameters
callback: (nullable void (^) (BOOL success)) callback;
NSDictionary *mboxParameters1 = @{@"status":@"platinum"};
NSDictionary *productParameters1 = @{@"id":@"24D3412",
@"categoryId":@"Books"};
NSDictionary *orderParameters1 = @{@"id":@"ADCKKIM",
@"total":@"344.30",
@"purchasedProductIds":@"34, 125, 99"};
NSDictionary *mboxParameters2 = @{@"userType":@"Paid"};
NSDictionary *productParameters2 = @{@"id":@"764334",
@"categoryId":@"Online"};
NSArray *purchaseIDs = @[@"id1",@"id2"];
NSDictionary *orderParameters2 = @{@"id":@"4t4uxksa",
@"total":@"54.90",
@"purchasedProductIds":purchaseIDs};
// Creating Prefetch Objects
ACPTargetPrefetchObject *prefetch1 = [ACPTargetPrefetchObject prefetchObjectWithName:@"logo" mboxParameters:mboxParameters1];
prefetch1.productParameters = productParameters1;
prefetch1.orderParameters = orderParameters1;
ACPTargetPrefetchObject *prefetch2 = [ACPTargetPrefetchObject prefetchObjectWithName:@"buttonColor" mboxParameters:mboxParameters2];
prefetch2.productParameters = productParameters2;
prefetch2.orderParameters = orderParameters2;
// Creating prefetch Array
NSArray *prefetchArray = @[prefetch1,prefetch2];
// Creating Profile parameters
NSDictionary *profileParameters = @{@"age":@"20-32"};
// Target API Call
[ACPTarget prefetchContent:prefetchArray withProfileParameters:profileParameters callback:^(BOOL isSuccess){
// do something with the Boolean result
}];
{% endtab %} {% endtabs %}
To clear prefetched, cached offer data, use the following:
{% tabs %} {% tab title="Android" %}
public static void clearPrefetchCache()
Target.clearPrefetchCache();
{% endtab %}
{% tab title="iOS" %}
+ (void) clearPrefetchCache;
[ACPTarget clearPrefetchCache];
{% endtab %} {% endtabs %}
Visual preview mode allows you to easily perform end-to-end QA for Target activities by enrolling and previewing these activities on your device without requiring a specialized testing setup.
To get started, make sure to follow the Target's documentation on setting up a URL scheme and generating preview links.
You may also set an app deep link that can be triggered when selections are made in the preview mode by using the following methods:
{% tabs %} {% tab title="Android" %}
public static void setPreviewRestartDeepLink(final Uri deepLink);
Target.setPreviewRestartDeepLink("myApp://HomePage");
{% endtab %}
{% tab title="iOS" %}
+ (void) setPreviewRestartDeepLink: (nonnull NSURL*) deepLink;
[ACPTarget setPreviewRestartDeepLink:@"myApp://HomePage"];
ACPTarget.setPreviewRestartDeepLink("myApp://HomePage")
{% endtab %}
{% endtabs %}
To see the performance of your Target activities for certain segments you can set up the Analytics for Target (A4T) cross-solution integration by enabling the A4T campaigns. This integration allows you 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)
If you need to update SDK configuration, programmatically, please use the following information to change your Target configuration values. For more information, Configuration Methods Reference.
Key | Description |
---|---|
target.clientcode | Client code for your account. |
target.timeout | Time, in seconds, to wait for a response from Target servers before timing out. |
target.environmentId | Environment ID you want to use, if this is left blank, the default production environment will be used. |
- How to get your Target client code? See this page, under Client
- What is an mbox?
- What is Analytics for Target (A4T)?