Adobe Journey Optimizer - Decisioning Extension
The Adobe Journey Optimizer - Decisioning extension powers real-time personalization workflows using Adobe Journey Optimizer - Offer Decisioning or Adobe Target in mobile apps via the Edge Network. It helps deliver personalized decisions to your app and enables tracking user interactions with the proposed decisions.
Prerequisites
Before starting, make sure the following steps are completed.
- Your organization is provisioned for edge decisioning.
- If using Adobe Target, Target activities are set up in your desired workspace in your organization on Target UI. For more details, see the Target activities guide.
- If using Journey Optimizer - Offer Decisioning, decisions are set up in your desired sandbox in your organization on Experience Platform UI. For more details, see the create decisions guide.
Adobe Experience Platform Data Collection setup
Configure the Datastream for Adobe Target and/or Journey Optimizer - Offer Decisioning
On Experience Platform Data Collection, navigate to Data Collection > Datatreams using the left navigation panel. Select an existing datastream or create a new datastream. For more details, see the configure datastreams guide.
- In the datastream, click on the desired environment from the list. Make sure Adobe Experience Platform section is enabled and configured with the required information like Sandbox and Event Dataset.
- For Journey Optimizer - Offer Decisioning, navigate to Adobe Experience Platform section and enable Offer Decisioning checkbox.
- For Adobe Target, navigate to Adobe Target section and enable it. Specify the configuration. For more information on the configuration settings, refer to the Administer Target Overview.
- Click Save.
Configure Adobe Journey Optimizer - Decisioning extension in Tag property for Mobile
On Experience Platform Data Collection, navigate to Data Collection > Tags using the left navigation panel. Select an existing mobile tag property or create a new property.
- In your mobile property, navigate to Extensions in the left navigation panel and click on the Catalog tab.
- In the extensions Catalog, search or locate the Adobe Journey Optimizer - Decisioning extension, and click Install.
- Since an extension configuration is not necessary, click Save.
- Follow the publishing process to update SDK configuration. For more details, see the publish the configuration guide.
Integrate Experience Platform Optimize SDK in your mobile application
For the AEPOptimize APIs to work properly, you need to integrate Mobile Core and Edge extensions in your mobile app. For more details see, documentation on Mobile Core and Adobe Experience Platform Edge Network.
Download and import the Optimize extension
- Add the Mobile Core, Edge, Identity for Edge Network and Optimize dependencies in your app's gradle file.
Kotlin
Copied to your clipboardimplementation(platform("com.adobe.marketing.mobile:sdk-bom:3.+"))implementation("com.adobe.marketing.mobile:core")implementation("com.adobe.marketing.mobile:edgeidentity")implementation("com.adobe.marketing.mobile:edge")implementation("com.adobe.marketing.mobile:optimize")
Groovy
Copied to your clipboardimplementation platform('com.adobe.marketing.mobile:sdk-bom:3.+')implementation 'com.adobe.marketing.mobile:core'implementation 'com.adobe.marketing.mobile:edgeidentity'implementation 'com.adobe.marketing.mobile:edge'implementation 'com.adobe.marketing.mobile:optimize'
Using dynamic dependency versions is not recommended for production apps. Please read the managing Gradle dependencies guide for more information.
- Import the Mobile Core, Edge, Edge Identity, and Optimize extensions in your application class.
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCore;import com.adobe.marketing.mobile.Edge;import com.adobe.marketing.mobile.edge.identity.Identity;import com.adobe.marketing.mobile.Optimize;
- Configure your app target to fetch Mobile Core, Edge, Identity for Edge Network and Optimize from Cocoapods by specifying the following pod dependencies in your
Podfile
.
Copied to your clipboarduse_frameworks!target 'YourAppTarget' dopod 'AEPCore', '~> 5.0'pod 'AEPEdge', '~> 5.0'pod 'AEPEdgeIdentity', '~> 5.0'pod 'AEPOptimize', '~> 5.0'end
- Import the Mobile Core, Edge, Edge Identity, and Optimize libraries.
Swift
Copied to your clipboard// AppDelegate.swiftimport AEPCoreimport AEPEdgeimport AEPEdgeIdentityimport AEPOptimize
Objective-C
Copied to your clipboard// AppDelegate.h@import AEPCore;@import AEPEdge;@import AEPEdgeIdentity;@import AEPOptimize;
- Add the Mobile Core, Edge, Identity for Edge Network and Optimize dependencies in your app's gradle file.
Kotlin
Copied to your clipboardimplementation(platform("com.adobe.marketing.mobile:sdk-bom:3.+"))implementation("com.adobe.marketing.mobile:core")implementation("com.adobe.marketing.mobile:edgeidentity")implementation("com.adobe.marketing.mobile:edge")implementation("com.adobe.marketing.mobile:optimize")
Groovy
Copied to your clipboardimplementation platform('com.adobe.marketing.mobile:sdk-bom:3.+')implementation 'com.adobe.marketing.mobile:core'implementation 'com.adobe.marketing.mobile:edgeidentity'implementation 'com.adobe.marketing.mobile:edge'implementation 'com.adobe.marketing.mobile:optimize'
Using dynamic dependency versions is not recommended for production apps. Please read the managing Gradle dependencies guide for more information.
- Import the Mobile Core, Edge, Edge Identity, and Optimize extensions in your application class.
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCore;import com.adobe.marketing.mobile.Edge;import com.adobe.marketing.mobile.edge.identity.Identity;import com.adobe.marketing.mobile.Optimize;
- Configure your app target to fetch Mobile Core, Edge, Identity for Edge Network and Optimize from Cocoapods by specifying the following pod dependencies in your
Podfile
.
Copied to your clipboarduse_frameworks!target 'YourAppTarget' dopod 'AEPCore', '~> 5.0'pod 'AEPEdge', '~> 5.0'pod 'AEPEdgeIdentity', '~> 5.0'pod 'AEPOptimize', '~> 5.0'end
- Import the Mobile Core, Edge, Edge Identity, and Optimize libraries.
Swift
Copied to your clipboard// AppDelegate.swiftimport AEPCoreimport AEPEdgeimport AEPEdgeIdentityimport AEPOptimize
Objective-C
Copied to your clipboard// AppDelegate.h@import AEPCore;@import AEPEdge;@import AEPEdgeIdentity;@import AEPOptimize;
Register the extensions with Mobile Core
Java
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCore;import com.adobe.marketing.mobile.Edge;import com.adobe.marketing.mobile.edge.identity.Identity;import com.adobe.marketing.mobile.optimize.Optimize;import com.adobe.marketing.mobile.AdobeCallback;public class MainApp extends Application {private final String ENVIRONMENT_FILE_ID = "YOUR_APP_ENVIRONMENT_ID";@Overridepublic void onCreate() {super.onCreate();MobileCore.setApplication(this);MobileCore.configureWithAppID(ENVIRONMENT_FILE_ID);MobileCore.registerExtensions(Arrays.asList(Edge.EXTENSION, Identity.EXTENSION, Optimize.EXTENSION),o -> Log.d("MainApp", "Adobe Journey Optimizer - Decisioning Mobile SDK was initialized."));}}
Kotlin
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCoreimport com.adobe.marketing.mobile.Edgeimport com.adobe.marketing.mobile.edge.identity.Identityimport com.adobe.marketing.mobile.optimize.Optimizeimport com.adobe.marketing.mobile.AdobeCallbackclass 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(Edge.EXTENSION, Identity.EXTENSION, Optimize.EXTENSION)) {Log.d("MainApp", "Adobe Experience Platform Mobile SDK was initialized")}}}
Swift
Copied to your clipboard// AppDelegate.swiftimport AEPCoreimport AEPEdgeimport AEPEdgeIdentityimport AEPOptimize@UIApplicationMainfinal class AppDelegate: UIResponder, UIApplicationDelegate {var window: UIWindow?func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {// register the extensionsMobileCore.registerExtensions([Edge.self, AEPEdgeIdentity.Identity.self, Optimize.self]) {MobileCore.configureWith(appId: <YOUR_ENVIRONMENT_FILE_ID>) // Replace <YOUR_ENVIRONMENT_FILE_ID> with a String containing your own ID.}return true}}
Objective-C
Copied to your clipboard// AppDelegate.m@import AEPCore;@import AEPEdge;@import AEPEdgeIdentity;@import AEPOptimize;- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {// register the extensions[AEPMobileCore registerExtensions:@[AEPMobileEdge.class, AEPMobileEdgeIdentity.class, , AEPMobileOptimize.class] completion:^{[AEPMobileCore configureWithAppId: <YOUR_ENVIRONMENT_FILE_ID>]; // Replace <YOUR_ENVIRONMENT_FILE_ID> with a String containing your own ID.}];...}
Java
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCore;import com.adobe.marketing.mobile.Edge;import com.adobe.marketing.mobile.edge.identity.Identity;import com.adobe.marketing.mobile.optimize.Optimize;import com.adobe.marketing.mobile.AdobeCallback;public class MainApp extends Application {private final String ENVIRONMENT_FILE_ID = "YOUR_APP_ENVIRONMENT_ID";@Overridepublic void onCreate() {super.onCreate();MobileCore.setApplication(this);MobileCore.configureWithAppID(ENVIRONMENT_FILE_ID);MobileCore.registerExtensions(Arrays.asList(Edge.EXTENSION, Identity.EXTENSION, Optimize.EXTENSION),o -> Log.d("MainApp", "Adobe Journey Optimizer - Decisioning Mobile SDK was initialized."));}}
Kotlin
Copied to your clipboardimport com.adobe.marketing.mobile.MobileCoreimport com.adobe.marketing.mobile.Edgeimport com.adobe.marketing.mobile.edge.identity.Identityimport com.adobe.marketing.mobile.optimize.Optimizeimport com.adobe.marketing.mobile.AdobeCallbackclass 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(Edge.EXTENSION, Identity.EXTENSION, Optimize.EXTENSION)) {Log.d("MainApp", "Adobe Experience Platform Mobile SDK was initialized")}}}
Swift
Copied to your clipboard// AppDelegate.swiftimport AEPCoreimport AEPEdgeimport AEPEdgeIdentityimport AEPOptimize@UIApplicationMainfinal class AppDelegate: UIResponder, UIApplicationDelegate {var window: UIWindow?func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {// register the extensionsMobileCore.registerExtensions([Edge.self, AEPEdgeIdentity.Identity.self, Optimize.self]) {MobileCore.configureWith(appId: <YOUR_ENVIRONMENT_FILE_ID>) // Replace <YOUR_ENVIRONMENT_FILE_ID> with a String containing your own ID.}return true}}
Objective-C
Copied to your clipboard// AppDelegate.m@import AEPCore;@import AEPEdge;@import AEPEdgeIdentity;@import AEPOptimize;- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {// register the extensions[AEPMobileCore registerExtensions:@[AEPMobileEdge.class, AEPMobileEdgeIdentity.class, , AEPMobileOptimize.class] completion:^{[AEPMobileCore configureWithAppId: <YOUR_ENVIRONMENT_FILE_ID>]; // Replace <YOUR_ENVIRONMENT_FILE_ID> with a String containing your own ID.}];...}
Adobe Journey Optimizer - Offer Decisioning
DecisionScope
The DecisionScope
public class provides a constructor to create a scope object using the activityId, placementId, and optional itemCount. The decision scope activity and placement information can be obtained from the decision on the Experience Platform UI.
Swift
Copied to your clipboardlet decisionScope = DecisionScope(activityId: "xcore:offer-activity:1111111111111111",placementId: "xcore:offer-placement:1111111111111111",itemCount: 3)
Objective-C
Copied to your clipboardAEPDecisionScope* decisionScope = [[AEPDecisionScope alloc] initWithActivityId:@"xcore:offer-activity:1111111111111111"placementId:@"xcore:offer-placement:1111111111111111"itemCount:3];
Java
Copied to your clipboardfinal DecisionScope decisionScope = DecisionScope("xcore:offer-activity:1111111111111111", "xcore:offer-placement:1111111111111111", 3);
Swift
Copied to your clipboardlet decisionScope = DecisionScope(activityId: "xcore:offer-activity:1111111111111111",placementId: "xcore:offer-placement:1111111111111111",itemCount: 3)
Objective-C
Copied to your clipboardAEPDecisionScope* decisionScope = [[AEPDecisionScope alloc] initWithActivityId:@"xcore:offer-activity:1111111111111111"placementId:@"xcore:offer-placement:1111111111111111"itemCount:3];
Alternately, another of the class's constructor can be used to create a scope object using the encoded decision scope. The encoded scope can also be read directly from the decision on the Experience Platform UI.
Swift
Copied to your clipboardlet decisionScope = DecisionScope(name: "eyJ4ZG06YWN0aXZpdHlJZCI6Inhjb3JlOm9mZmVyLWFjdGl2aXR5OjEyYmEyZjM4MWJjYTY3NWUiLCJ4ZG06cGxhY2VtZW50SWQiOiJ4Y29yZTpvZmZlci1wbGFjZW1lbnQ6MTJiOWEwMDA1NTUwNzM1NyIsICJ4ZG06aXRlbUNvdW50IjozfQ==")
Objective-C
Copied to your clipboardAEPDecisionScope* decisionScope = [[AEPDecisionScope alloc] initWithName:@"eyJ4ZG06YWN0aXZpdHlJZCI6Inhjb3JlOm9mZmVyLWFjdGl2aXR5OjEyYmEyZjM4MWJjYTY3NWUiLCJ4ZG06cGxhY2VtZW50SWQiOiJ4Y29yZTpvZmZlci1wbGFjZW1lbnQ6MTJiOWEwMDA1NTUwNzM1NyIsICJ4ZG06aXRlbUNvdW50IjozfQ=="];
Java
Copied to your clipboardfinal DecisionScope decisionScope = DecisionScope("eyJ4ZG06YWN0aXZpdHlJZCI6Inhjb3JlOm9mZmVyLWFjdGl2aXR5OjEyYmEyZjM4MWJjYTY3NWUiLCJ4ZG06cGxhY2VtZW50SWQiOiJ4Y29yZTpvZmZlci1wbGFjZW1lbnQ6MTJiOWEwMDA1NTUwNzM1NyIsICJ4ZG06aXRlbUNvdW50IjozfQ==");
Swift
Copied to your clipboardlet decisionScope = DecisionScope(name: "eyJ4ZG06YWN0aXZpdHlJZCI6Inhjb3JlOm9mZmVyLWFjdGl2aXR5OjEyYmEyZjM4MWJjYTY3NWUiLCJ4ZG06cGxhY2VtZW50SWQiOiJ4Y29yZTpvZmZlci1wbGFjZW1lbnQ6MTJiOWEwMDA1NTUwNzM1NyIsICJ4ZG06aXRlbUNvdW50IjozfQ==")
Objective-C
Copied to your clipboardAEPDecisionScope* decisionScope = [[AEPDecisionScope alloc] initWithName:@"eyJ4ZG06YWN0aXZpdHlJZCI6Inhjb3JlOm9mZmVyLWFjdGl2aXR5OjEyYmEyZjM4MWJjYTY3NWUiLCJ4ZG06cGxhY2VtZW50SWQiOiJ4Y29yZTpvZmZlci1wbGFjZW1lbnQ6MTJiOWEwMDA1NTUwNzM1NyIsICJ4ZG06aXRlbUNvdW50IjozfQ=="];
Adobe Target
Target location
The DecisionScope
public class provides a designated initializer which can be used to create a Target location (or mbox).
Target Parameters
Target Parameters can be sent in a personalization query request to the Experience Edge network by adding them in data
dictionary when calling the updatePropositions
API.
Java
Copied to your clipboardfinal Map<String, Object> data = new HashMap<>();final Map<String, String> targetParameters = new HashMap<>();// Add mbox parameterstargetParameters.put("someKey", "someValue");// Add profile parameters - prefix with profile.targetParameters.put("profile.membershipLevel", "platinum");// Add product parameterstargetParameters.put("productId", "111");targetParameters.put("categoryId", "Books");// Add order parameterstargetParameters.put("orderId", "10");targetParameters.put("orderTotal", "110.56");targetParameters.put("purchasedProductIds", "111");data.put("__adobe", new HashMap<String, Object>() {{put("target", targetParameters);}});final DecisionScope decisionScope = DecisionScope("myTargetLocation") // Target location (or mbox)final List<DecisionScope> decisionScopes = new ArrayList<>();decisionScopes.add(decisionScope);Optimize.updatePropositions(decisionScopes, null, data);
Swift
Copied to your clipboardvar data: [String: Any] = [:]var targetParameters: [String: String] = [:]// Add mbox parameterstargetParameters["someKey"] = "someValue"// Add profile parameters - prefix with profile.targetParameters["profile.membershipLevel"] = "platinum"// Add product parameterstargetParameters["productId"] = "111"targetParameters["categoryId"] = "Books"// Add order parameterstargetParameters["orderId"] = "10"targetParameters["orderTotal"] = "110.56"targetParameters["purchasedProductIds"] = "111"data["__adobe"] = ["target": targetParameters]let decisionScope = DecisionScope(name: "myTargetLocation") // Target location (or mbox)Optimize.updatePropositions(for: [decisionScope] withXdm: nil andData: data)
Objective-C
Copied to your clipboardNSMutableDictionary* data = [NSMutableDictionary dictionary];NSMutableDictionary* targetParameters = [NSMutableDictionary dictionary];// Add mbox parameterstargetParameters[@"someKey"] = @"someValue";// Add profile parameters - prefix with profile.targetParameters[@"profile.membershipLevel"] = @"platinum";// Add product parameterstargetParameters[@"productId"] = @"111";targetParameters[@"categoryId"] = @"Books";// Add order parameterstargetParameters[@"orderId"] = @"10";targetParameters[@"orderTotal"] = @"110.56";targetParameters[@"purchasedProductIds"] = @"111";[data setObject:[NSDictionary dictionaryWithObject:targetParameters forKey:@"target"] forKey:@"__adobe"];AEPDecisionScope* decisionScope = [[AEPDecisionScope alloc] initWithName:@"myTargetLocation"]; // Target location (or mbox)[AEPMobileOptimize updatePropositions:@[decisionScope] withXdm:nil andData:data];
Java
Copied to your clipboardfinal Map<String, Object> data = new HashMap<>();final Map<String, String> targetParameters = new HashMap<>();// Add mbox parameterstargetParameters.put("someKey", "someValue");// Add profile parameters - prefix with profile.targetParameters.put("profile.membershipLevel", "platinum");// Add product parameterstargetParameters.put("productId", "111");targetParameters.put("categoryId", "Books");// Add order parameterstargetParameters.put("orderId", "10");targetParameters.put("orderTotal", "110.56");targetParameters.put("purchasedProductIds", "111");data.put("__adobe", new HashMap<String, Object>() {{put("target", targetParameters);}});final DecisionScope decisionScope = DecisionScope("myTargetLocation") // Target location (or mbox)final List<DecisionScope> decisionScopes = new ArrayList<>();decisionScopes.add(decisionScope);Optimize.updatePropositions(decisionScopes, null, data);
Swift
Copied to your clipboardvar data: [String: Any] = [:]var targetParameters: [String: String] = [:]// Add mbox parameterstargetParameters["someKey"] = "someValue"// Add profile parameters - prefix with profile.targetParameters["profile.membershipLevel"] = "platinum"// Add product parameterstargetParameters["productId"] = "111"targetParameters["categoryId"] = "Books"// Add order parameterstargetParameters["orderId"] = "10"targetParameters["orderTotal"] = "110.56"targetParameters["purchasedProductIds"] = "111"data["__adobe"] = ["target": targetParameters]let decisionScope = DecisionScope(name: "myTargetLocation") // Target location (or mbox)Optimize.updatePropositions(for: [decisionScope] withXdm: nil andData: data)
Objective-C
Copied to your clipboardNSMutableDictionary* data = [NSMutableDictionary dictionary];NSMutableDictionary* targetParameters = [NSMutableDictionary dictionary];// Add mbox parameterstargetParameters[@"someKey"] = @"someValue";// Add profile parameters - prefix with profile.targetParameters[@"profile.membershipLevel"] = @"platinum";// Add product parameterstargetParameters[@"productId"] = @"111";targetParameters[@"categoryId"] = @"Books";// Add order parameterstargetParameters[@"orderId"] = @"10";targetParameters[@"orderTotal"] = @"110.56";targetParameters[@"purchasedProductIds"] = @"111";[data setObject:[NSDictionary dictionaryWithObject:targetParameters forKey:@"target"] forKey:@"__adobe"];AEPDecisionScope* decisionScope = [[AEPDecisionScope alloc] initWithName:@"myTargetLocation"]; // Target location (or mbox)[AEPMobileOptimize updatePropositions:@[decisionScope] withXdm:nil andData:data];
Target Third Party ID
To use Target Third Party ID in the Experience Edge mobile workflows, the corresponding namespace needs to be configured in Experience Platform Data Collection.
- On Experience Platform Data Collection, navigate to Data Collection > Datatreams using the left navigation panel.
- Select your configured datastream and click on the desired environment from the list.
- Navigate to Adobe Target section, specify the Target Third Party ID Namespace.
- Click Save.
In your mobile application, integrate the Identity for Edge Network extension to add the Target Third Party ID in the Identity Map in the personalization query request to the Edge network when calling the updatePropositions
API. For more details, see the Identity for Edge Network - updateIdentities API.
Swift
Copied to your clipboardlet identityMap = IdentityMap()identityMap.add(item: IdentityItem(id: "1111", authenticatedState: AuthenticatedState.authenticated, primary: true),withNamespace: "userCRMID") // userCRMID being used as Third Party IDIdentity.updateIdentities(with: identityMap)
Objective-C
Copied to your clipboardAEPIdentityItem *item = [[AEPIdentityItem alloc] initWithId:@"1111" authenticatedState:AEPAuthenticatedStateAuthenticated primary:true];AEPIdentityMap *identityMap = [[AEPIdentityMap alloc] init];[identityMap addItem:item withNamespace:@"userCRMID"]; // userCRMID being used as Third Party ID[AEPMobileEdgeIdentity updateIdentities:identityMap];
Java
Copied to your clipboardfinal IdentityItem item = new IdentityItem("1111", AuthenticatedState.AUTHENTICATED, true);final IdentityMap identityMap = new IdentityMap();identityMap.addItem(item, "userCRMID") // userCRMID being used as Third Party IDIdentity.updateIdentities(identityMap);
Swift
Copied to your clipboardlet identityMap = IdentityMap()identityMap.add(item: IdentityItem(id: "1111", authenticatedState: AuthenticatedState.authenticated, primary: true),withNamespace: "userCRMID") // userCRMID being used as Third Party IDIdentity.updateIdentities(with: identityMap)
Objective-C
Copied to your clipboardAEPIdentityItem *item = [[AEPIdentityItem alloc] initWithId:@"1111" authenticatedState:AEPAuthenticatedStateAuthenticated primary:true];AEPIdentityMap *identityMap = [[AEPIdentityMap alloc] init];[identityMap addItem:item withNamespace:@"userCRMID"]; // userCRMID being used as Third Party ID[AEPMobileEdgeIdentity updateIdentities:identityMap];
Target Audience Segmentation using Mobile Lifecycle Metrics
To send mobile Lifecycle metrics to Target for creating audiences, a rule needs to be set up on Experience Platform Data Collection to attach these metrics to the Edge personalization query requests. Follow the link to learn how to target visitors using Custom Parameters in Adobe Target.
Create a rule
On Experience Platform Data Collection, navigate to Data Collection > Tags using the left navigation panel. Select an existing mobile tag property or create a new property.
- In your mobile property, navigate to Rules in the left navigation panel and click on Create New Rule. If there already are existing rules, you can click on Add Rule to add a new rule.
- Provide a name for your rule. In the example here, the rule is named "Attach Mobile Lifecycle Metrics to Personalization Query Requests".
Select an event
- Under the Events section, click on Add.
- From the Extension dropdown list, select Adobe Experience Platform Edge Network.
- From the Event Type dropdown list, select AEP Request Event.
- On the right pane, click on + to specify XDM Event Type equals personalization.request.
- Click on Keep Changes.
Define the action
- Under the Actions section, click on Add.
- From the Extension dropdown list, select Mobile Core.
- From the Action Type dropdown list, select Attach Data.
- On the right pane, specify the JSON Payload containing metrics of interest. An example JSON Payload containing all of the mobile Lifecycle metrics is shown below.
- Click on Keep Changes.
Copied to your clipboard{"data": {"__adobe": {"target": {"a.appID": "{%~state.com.adobe.module.lifecycle/lifecyclecontextdata.appid%}","a.locale": "{%~state.com.adobe.module.lifecycle/lifecyclecontextdata.locale%}","a.RunMode": "{%~state.com.adobe.module.lifecycle/lifecyclecontextdata.runmode%}","a.Launches": "{%~state.com.adobe.module.lifecycle/lifecyclecontextdata.launches%}","a.DayOfWeek": "{%~state.com.adobe.module.lifecycle/lifecyclecontextdata.dayofweek%}","a.HourOfDay": "{%~state.com.adobe.module.lifecycle/lifecyclecontextdata.hourofday%}","a.OSVersion": "{%~state.com.adobe.module.lifecycle/lifecyclecontextdata.osversion%}","a.CrashEvent": "{%~state.com.adobe.module.lifecycle/lifecyclecontextdata.crashevent%}","a.DeviceName": "{%~state.com.adobe.module.lifecycle/lifecyclecontextdata.devicename%}","a.Resolution": "{%~state.com.adobe.module.lifecycle/lifecyclecontextdata.resolution%}","a.CarrierName": "{%~state.com.adobe.module.lifecycle/lifecyclecontextdata.carriername%}","a.InstallDate": "{%~state.com.adobe.module.lifecycle/lifecyclecontextdata.installdate%}","a.LaunchEvent": "{%~state.com.adobe.module.lifecycle/lifecyclecontextdata.launchevent%}","a.InstallEvent": "{%~state.com.adobe.module.lifecycle/lifecyclecontextdata.installevent%}","a.UpgradeEvent": "{%~state.com.adobe.module.lifecycle/lifecyclecontextdata.upgradeevent%}","a.DaysSinceLastUse": "{%~state.com.adobe.module.lifecycle/lifecyclecontextdata.dayssincelastuse%}","a.DailyEngUserEvent": "{%~state.com.adobe.module.lifecycle/lifecyclecontextdata.dailyenguserevent%}","a.DaysSinceFirstUse": "{%~state.com.adobe.module.lifecycle/lifecyclecontextdata.dayssincefirstuse%}","a.PrevSessionLength": "{%~state.com.adobe.module.lifecycle/lifecyclecontextdata.prevsessionlength%}","a.MonthlyEngUserEvent": "{%~state.com.adobe.module.lifecycle/lifecyclecontextdata.monthlyenguserevent%}","a.DaysSinceLastUpgrade": "{%~state.com.adobe.module.lifecycle/lifecyclecontextdata.dayssincelastupgrade%}","a.LaunchesSinceUpgrade": "{%~state.com.adobe.module.lifecycle/lifecyclecontextdata.launchessinceupgrade%}","a.ignoredSessionLength": "{%~state.com.adobe.module.lifecycle/lifecyclecontextdata.ignoredsessionlength%}"}}}}
Save the rule and republish the configuration
After you finish your rule configuration, verify the rule details are as shown below:
- Click on Save.
- Republish your configuration to the desired environment.
Analytics for Target (A4T)
Set up the Analytics for Target (A4T) cross-solution integration by enabling the A4T campaigns to use Adobe Analytics as the reporting source for a Target activity. Subsequently, 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, based on server-side or client-side logging appropriate actions need to be taken in the customer mobile apps to register impressions, visits/visitors and possibly conversions with Adobe Analytics.
When using server-side logging, tracking methods need to be implemented in the customer mobile apps for server-side data exchange to happen with Adobe Analytics. This is because Optimize mobile SDK operates in prefetch mode and display notifications are required to indicate scope content is rendered so Experience Edge should share relevant A4T payload with Adobe Analytics. In addition, content interactions need to be reported using click notifications and these may lead to additional A4T data exchange with Adobe Analytics.
Server-side logging: If Analytics is enabled and configured in your datastream for the desired environment, then it is considered server-side logging. In this case, the Experience Edge handles forwarding any Target A4T payloads to Adobe Analytics, upon tracking method calls, and no Analytics tokens are returned to the client.
Client-side logging: If Analytics is disabled in your datastream for the desired environment, then it is considered client-side logging. In this case, Analytics tokens are returned to the client and it is the responsibility of the customer to extract and send the data to Adobe Analytics, if desired.
Tracking
Proposition tracking using direct Offer class methods
User interactions with the decision propositions can be tracked using the following public methods in the Offer
class.
Java
Copied to your clipboardpublic class Offer {.../*** Dispatches an event for the Edge network extension to send an Experience Event to the Edge network with the display interaction data for the* given {@code Proposition} offer.*/public void displayed() {...}/*** Dispatches an event for the Edge network extension to send an Experience Event to the Edge network with the tap interaction data for the* given {@code Proposition} offer.*/public void tapped() {...}}
Swift
Copied to your clipboardpublic extension Offer {/// Dispatches an event for the Edge extension to send an Experience Event to the Edge network with the display interaction data for the given proposition item.func displayed() {...}/// Dispatches an event for the Edge extension to send an Experience Event to the Edge network with the tap interaction data for the given proposition item.func tapped() {...}}
Java
Copied to your clipboardpublic class Offer {.../*** Dispatches an event for the Edge network extension to send an Experience Event to the Edge network with the display interaction data for the* given {@code Proposition} offer.*/public void displayed() {...}/*** Dispatches an event for the Edge network extension to send an Experience Event to the Edge network with the tap interaction data for the* given {@code Proposition} offer.*/public void tapped() {...}}
Swift
Copied to your clipboardpublic extension Offer {/// Dispatches an event for the Edge extension to send an Experience Event to the Edge network with the display interaction data for the given proposition item.func displayed() {...}/// Dispatches an event for the Edge extension to send an Experience Event to the Edge network with the tap interaction data for the given proposition item.func tapped() {...}}
Upon calling these Offer
methods, an Experience Event is sent to the Edge network with the proposition interaction data for the given offer.
Proposition tracking using Edge extension API
For more advanced tracking use cases, additional public methods are available in the Offer
and Proposition
/OptimizeProposition
classes. These methods can be used to generate XDM formatted data for Experience Event - Proposition Interactions
and Experience Event - Proposition Reference
field groups.
Java
Copied to your clipboardpublic class Offer {.../*** Generates a map containing XDM formatted data for {@code Experience Event - Proposition Interactions} field group from this {@code Proposition} item.** The returned XDM data does contain the {@code eventType} for the Experience Event with value {@code decisioning.propositionDisplay}.** Note: The Edge sendEvent API can be used to dispatch this data in an Experience Event along with any additional XDM, free-form data, and override* dataset identifier.** @return {@code Map<String, Object>} containing the XDM data for the proposition interaction.*/public Map<String, Object> generateDisplayInteractionXdm() {...}/*** Generates a map containing XDM formatted data for {@code Experience Event - Proposition Interactions} field group from this {@code Proposition} offer.** The returned XDM data contains the {@code eventType} for the Experience Event with value {@code decisioning.propositionInteract}.** Note: The Edge sendEvent API can be used to dispatch this data in an Experience Event along with any additional XDM, free-form data, and override* dataset identifier.** @return {@code Map<String, Object>} containing the XDM data for the proposition interaction.*/public Map<String, Object> generateTapInteractionXdm() {...}}
Copied to your clipboardpublic class Proposition {.../*** Generates a map containing XDM formatted data for {@code Experience Event - Proposition Reference} field group from this {@code Proposition}.** The returned XDM data does not contain {@code eventType} for the Experience Event.** @return {@code Map<String, Object>} containing the XDM data for the proposition reference.*/public Map<String, Object> generateReferenceXdm() {...}}
Swift
Copied to your clipboardpublic extension Offer {/// Creates a dictionary containing XDM formatted data for `Experience Event - Proposition Interactions` field group from the given proposition option.////// The Edge `sendEvent(experienceEvent:_:)` API can be used to dispatch this data in an Experience Event along with any additional XDM, free-form data, or override dataset identifier.////// - Note: The returned XDM data also contains the `eventType` for the Experience Event with value `decisioning.propositionDisplay`./// - Returns A dictionary containing XDM data for the proposition interactions.func generateDisplayInteractionXdm() -> [String: Any] {...}/// Creates a dictionary containing XDM formatted data for `Experience Event - Proposition Interactions` field group from the given proposition option.////// The Edge `sendEvent(experienceEvent:_:)` API can be used to dispatch this data in an Experience Event along with any additional XDM, free-form data, or override dataset identifier.////// - Note: The returned XDM data also contains the `eventType` for the Experience Event with value `decisioning.propositionInteract`./// - Returns A dictionary containing XDM data for the proposition interactions.func generateTapInteractionXdm() -> [String: Any] {...}}
Copied to your clipboardpublic extension OptimizeProposition {/// Creates a dictionary containing XDM formatted data for `Experience Event - Proposition Reference` field group from the given proposition.////// The Edge `sendEvent(experienceEvent:_:)` API can be used to dispatch this data in an Experience Event along with any additional XDM, free-form data, or override dataset identifier.////// - Note: The returned XDM data does not contain an `eventType` for the Experience Event./// - Returns A dictionary containing XDM data for the proposition reference.func generateReferenceXdm() -> [String: Any] {...}}
Java
Copied to your clipboardpublic class Offer {.../*** Generates a map containing XDM formatted data for {@code Experience Event - Proposition Interactions} field group from this {@code Proposition} item.** The returned XDM data does contain the {@code eventType} for the Experience Event with value {@code decisioning.propositionDisplay}.** Note: The Edge sendEvent API can be used to dispatch this data in an Experience Event along with any additional XDM, free-form data, and override* dataset identifier.** @return {@code Map<String, Object>} containing the XDM data for the proposition interaction.*/public Map<String, Object> generateDisplayInteractionXdm() {...}/*** Generates a map containing XDM formatted data for {@code Experience Event - Proposition Interactions} field group from this {@code Proposition} offer.** The returned XDM data contains the {@code eventType} for the Experience Event with value {@code decisioning.propositionInteract}.** Note: The Edge sendEvent API can be used to dispatch this data in an Experience Event along with any additional XDM, free-form data, and override* dataset identifier.** @return {@code Map<String, Object>} containing the XDM data for the proposition interaction.*/public Map<String, Object> generateTapInteractionXdm() {...}}
Copied to your clipboardpublic class Proposition {.../*** Generates a map containing XDM formatted data for {@code Experience Event - Proposition Reference} field group from this {@code Proposition}.** The returned XDM data does not contain {@code eventType} for the Experience Event.** @return {@code Map<String, Object>} containing the XDM data for the proposition reference.*/public Map<String, Object> generateReferenceXdm() {...}}
Swift
Copied to your clipboardpublic extension Offer {/// Creates a dictionary containing XDM formatted data for `Experience Event - Proposition Interactions` field group from the given proposition option.////// The Edge `sendEvent(experienceEvent:_:)` API can be used to dispatch this data in an Experience Event along with any additional XDM, free-form data, or override dataset identifier.////// - Note: The returned XDM data also contains the `eventType` for the Experience Event with value `decisioning.propositionDisplay`./// - Returns A dictionary containing XDM data for the proposition interactions.func generateDisplayInteractionXdm() -> [String: Any] {...}/// Creates a dictionary containing XDM formatted data for `Experience Event - Proposition Interactions` field group from the given proposition option.////// The Edge `sendEvent(experienceEvent:_:)` API can be used to dispatch this data in an Experience Event along with any additional XDM, free-form data, or override dataset identifier.////// - Note: The returned XDM data also contains the `eventType` for the Experience Event with value `decisioning.propositionInteract`./// - Returns A dictionary containing XDM data for the proposition interactions.func generateTapInteractionXdm() -> [String: Any] {...}}
Copied to your clipboardpublic extension OptimizeProposition {/// Creates a dictionary containing XDM formatted data for `Experience Event - Proposition Reference` field group from the given proposition.////// The Edge `sendEvent(experienceEvent:_:)` API can be used to dispatch this data in an Experience Event along with any additional XDM, free-form data, or override dataset identifier.////// - Note: The returned XDM data does not contain an `eventType` for the Experience Event./// - Returns A dictionary containing XDM data for the proposition reference.func generateReferenceXdm() -> [String: Any] {...}}
The Edge sendEvent
API can then be used to send this tracking XDM data along with any additional XDM and freeform data to the Experience Edge network. Additionally, an override dataset can also be specified for tracking data. For more details, see Edge - sendEvent API.
Java
Copied to your clipboard// When a proposition is retrieved using getPropositions API or onUpdatePropositions API callback// and the corresponding offer is displayed, invoke method on Offer object to get the XDM data.final Map<String, Object> displayInteractionXdm = offer.generateDisplayInteractionXdm() // Offer display tracking XDMfinal Map<String, Object> additionalData = new HashMap<>();additionalData.put("someDataKey", "someDataValue");final ExperienceEvent experienceEvent = new ExperienceEvent.Builder().setXdmSchema(displayInteractionXdm).setData(additionalData).build();Edge.sendEvent(experienceEvent, null)
Swift
Copied to your clipboard// When a proposition is retrieved using getPropositions API or onUpdatePropositions API callback// and the corresponding offer is displayed, invoke method on Offer object to get the XDM data.let displayInteractionXdm = offer.generateDisplayInteractionXdm() // Offer display tracking XDMlet additionalData: [String: Any] = ["someDataKey": "someDataValue"]let experienceEvent = ExperienceEvent(xdm: displayInteractionXdm, data: additionalData)Edge.sendEvent(experienceEvent)
Objective-C
Copied to your clipboard// When a proposition is retrieved using getPropositions API or onUpdatePropositions API callback// and the corresponding offer is displayed, invoke method on Offer object to get the XDM data.NSDictionary* displayInteractionXdm = [offer generateDisplayInteractionXdm];NSDictionary* additionalData = @{@"someDataKey": @"someDataValue"};AEPExperienceEvent* experienceEvent = [[AEPExperienceEvent alloc] initWithXdm:displayInteractionXdm data:additionalData datasetIdentifier:nil];[AEPMobileEdge sendExperienceEvent:event completion:nil];
Java
Copied to your clipboard// When a proposition is retrieved using getPropositions API or onUpdatePropositions API callback// and the corresponding offer is displayed, invoke method on Offer object to get the XDM data.final Map<String, Object> displayInteractionXdm = offer.generateDisplayInteractionXdm() // Offer display tracking XDMfinal Map<String, Object> additionalData = new HashMap<>();additionalData.put("someDataKey", "someDataValue");final ExperienceEvent experienceEvent = new ExperienceEvent.Builder().setXdmSchema(displayInteractionXdm).setData(additionalData).build();Edge.sendEvent(experienceEvent, null)
Swift
Copied to your clipboard// When a proposition is retrieved using getPropositions API or onUpdatePropositions API callback// and the corresponding offer is displayed, invoke method on Offer object to get the XDM data.let displayInteractionXdm = offer.generateDisplayInteractionXdm() // Offer display tracking XDMlet additionalData: [String: Any] = ["someDataKey": "someDataValue"]let experienceEvent = ExperienceEvent(xdm: displayInteractionXdm, data: additionalData)Edge.sendEvent(experienceEvent)
Objective-C
Copied to your clipboard// When a proposition is retrieved using getPropositions API or onUpdatePropositions API callback// and the corresponding offer is displayed, invoke method on Offer object to get the XDM data.NSDictionary* displayInteractionXdm = [offer generateDisplayInteractionXdm];NSDictionary* additionalData = @{@"someDataKey": @"someDataValue"};AEPExperienceEvent* experienceEvent = [[AEPExperienceEvent alloc] initWithXdm:displayInteractionXdm data:additionalData datasetIdentifier:nil];[AEPMobileEdge sendExperienceEvent:event completion:nil];
Configuration keys
To update the SDK configuration programmatically, use the following information to change the Optimize extension configuration values. For more information, see the programmatic updates to Configuration guide.
Key | Required | Description | Data Type |
---|---|---|---|
optimize.datasetId | No | Override dataset's Identifier which can be obtained from the Experience Platform UI. For more details see, Datasets UI guide | String |
If the override dataset is used for proposition tracking, make sure the corresponding schema definition contains the Experience Event - Proposition Interaction
field group. For more information, see the setup schemas and datasets guide.