Adobe Experience Platform Offer Decisioning
Adobe Experience Platform Offer Decisioning mobile extension can deliver personalized offers that are managed in Offer Decisioning. You can create your offers and other related objects using the Offer Decisioning user interface (UI) or APIs. To learn more about Offer Decisioning, please refer to Offer Decisioning product documentation.

Prerequisites

  • IMS organization is enabled for edge decisioning
  • Offers and Activities are created
  • Adobe Experience Platform Core and Edge mobile extensions have been implemented in the app
  • Launch UI config is published

Limitations

Some offer constraints are currently not supported with the mobile Experience Edge workflows, for example Capping. The Capping field value specifies the number of times an offer can be presented across all users. For more details, see Offer eligibility rules and constraints guide.

Enable Offer Decisioning in Datastream configuration

To enable Offer Decisioning, you need to perform the following steps:
  1. 1.
    In Adobe Experience Platform Launch, navigate to the Datastreams from the left panel, then select the configuration that needs to be updated.
    Enable Adobe Experience Platform in your datastream configuration and check the Offer Decisioning box.
  1. 1.
    Add AEP Offer Decisioning extension to the project.
iOS — Swift

Swift

Use Cocoapods for integrating with AEP Mobile SDK:
1
platform :ios, '10.0'
2
3
use_frameworks!
4
target 'YourAppTarget' do
5
# Mobile SDK Core Bundle
6
pod 'AEPServices', :git => 'git@github.com:adobe/aepsdk-core-ios.git', :branch => 'main'
7
pod 'AEPCore', :git => 'git@github.com:adobe/aepsdk-core-ios.git', :branch => 'main'
8
pod 'AEPLifecycle', :git => 'git@github.com:adobe/aepsdk-core-ios.git', :branch => 'main'
9
pod 'AEPIdentity', :git => 'git@github.com:adobe/aepsdk-core-ios.git', :branch => 'main'
10
pod 'AEPSignal', :git => 'git@github.com:adobe/aepsdk-core-ios.git', :branch => 'main'
11
pod 'AEPRulesEngine', :git => 'git@github.com:adobe/aepsdk-rulesengine-ios.git', :branch => 'main'
12
pod 'AEPEdge', :git => 'git@github.com:adobe/aepsdk-edge-ios.git', :branch => 'main'
13
14
# AEP Offer Decisioning SDK
15
pod 'AEPOfferDecisioning', :git => 'git@github.com:adobe/aepsdk-offer-ios.git', :branch => 'main'
16
17
end
Copied!

Register the extension

Android
iOS — Swift

Java

1
public class MobileApp extends Application {
2
3
@Override
4
public void onCreate() {
5
super.onCreate();
6
MobileCore.setApplication(this);
7
MobileCore.configureWithAppID("yourAppId");
8
9
try {
10
Edge.registerExtension();
11
Identity.registerExtension();
12
Lifecycle.registerExtension();
13
OfferDecisioning.registerExtension(); //Register OfferDecisioning extension
14
MobileCore.start(new AdobeCallback() {
15
@Override
16
public void call(final Object o) {
17
// processing after start
18
}});
19
} catch (Exception e) {
20
//Log the exception
21
}
22
}
23
}
Copied!

Swift

1
import UIKit
2
import AEPCore
3
import AEPEdge
4
import AEPIdentity
5
import AEPLifecycle
6
import AEPSignal
7
import AEPOfferDecisioning
8
9
@UIApplicationMain
10
class AppDelegate: UIResponder, UIApplicationDelegate {
11
12
var window: UIWindow?
13
14
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
15
MobileCore.configureWith(appId: YOUR_APP_ID)
16
17
// register Mobile Core and AEP Edge extensions
18
MobileCore.registerExtensions([Edge.self, Identity.self, Lifecycle.self, Signal.self, OfferDecisioning.self])
19
20
return true
21
}
22
}
Copied!

Prefetch and retrieve offers

After you get everything correctly set up, you can now use the AEP Offer Decisioning extension to prefetch and retrieve the offers and then render the content in your app.

Decision Scope

For Offer Decisioning, Decision Scope is the JSON data structure which contains the activity and placement IDs you want the offer decisioning service to use to propose offers.
Decision scope JSON:
1
{
2
"activityId":"xcore:offer-activity:11cfb1fa93381aca",
3
"placementId":"xcore:offer-placement:1175009612b0100c"
4
}
Copied!
AEP Offer Decisioning extension provides a convenient class for you to construct the Decision Scope.
Android
iOS — Swift

Java

1
DecisionScope decisionScope = new DecisionScope("xcore:offer-activity:11cfb1fa93381aca", "xcore:offer-placement:1175009612b0100c");
Copied!

Swift

1
let decisionScope = DecisionScope(activityId: "xcore:offer-activity:11cfb1fa93381aca", placementId: "xcore:offer-placement:1175009612b0100c")
Copied!

Prefetch offers

AEP Offer Decisioning exension provides separate APIs to prefetch the offers and retrieves the offer contents. This design aims to help apps to build better user experience for their end users. We recommend the app to prefetch the offers in advance, so there is no latency by the time you retrieve the offer contents and render them.
Android
iOS — Swift

Java

1
// prefetch offers for decision scopes
2
OfferDecisioning.prefetchOffers(Arrays.asList(
3
new DecisionScope("xcore:offer-activity:11cfb1fa93381aca", "xcore:offer-placement:1175009612b0100c"),
4
new DecisionScope("xcore:offer-activity:11cfb1fa93381aca", "xcore:offer-placement:1175009612b0100d")));
5
// prefetch offers for decision scopes with additional expxperience event
6
OfferExperienceEvent exEvent = new OfferExperienceEvent(
7
new HashMap<String, Object>() {
8
{
9
put("xdmkey", "xdmvalue");
10
}
11
},null,"override-datasetId");
12
OfferDecisioning.prefetchOffers(Arrays.asList(
13
new DecisionScope("xcore:offer-activity:11cfb1fa93381aca", "xcore:offer-placement:1175009612b0100c"),
14
new DecisionScope("xcore:offer-activity:11cfb1fa93381aca", "xcore:offer-placement:1175009612b0100d")),
15
exEvent);
Copied!

Swift

1
let decisionScope1 = DecisionScope(activityId: "xcore:offer-activity:11cfb1fa93381aca", placementId: "xcore:offer-placement:1175009612b0100c")
2
let decisionScope2 = DecisionScope(activityId: "xcore:offer-activity:11cfb1fa93381aca", placementId: "xcore:offer-placement:1175009612b0100d")
3
4
OfferDecisioning.prefetchOffers(decisionScopes: [decisionScope1, decisionScope2])
5
6
// prefetch offers for decision scopes
7
OfferDecisioning.prefetchOffers(decisionScopes: [decisionScope1, decisionScope2])
8
9
// prefetch offers for decision scopes with additional expxperience event
10
let experienceEvent = OfferExperienceEvent(xdm: ["xdmkey": "xdmvalue"], data: nil, datasetIdentifier: "override-datasetId")
11
12
OfferDecisioning.prefetchOffers(decisionScopes: [decisionScope1, decisionScope2], experienceEvent: experienceEvent)
Copied!

Retrieve offers content

Once the offers have been prefetched, use the retrievePrefetchedOffers API to get the contents for the targeted decision scopes.
Android
iOS — Swift

Java

1
OfferDecisioning.retrievePrefetchedOffers(Arrays.asList(
2
new DecisionScope("xcore:offer-activity:11cfb1fa93381aca", "xcore:offer-placement:1175009612b0100c")),
3
new AdobeCallbackWithError<Map<DecisionScope, List<Offer>>>() {
4
@Override
5
public void fail(AdobeError adobeError) {
6
7
}
8
@Override
9
public void call(Map<DecisionScope, List<Offer>> decisionScopeListMap) {
10
StringBuffer sb = new StringBuffer();
11
// render the offer with offer.content
12
}
13
});
Copied!

Swift

1
let decisionScope = DecisionScope(activityId: "xcore:offer-activity:11cfb1fa93381aca", placementId: "xcore:offer-placement:1175009612b0100c")
2
3
OfferDecisioning.retrievePrefetchedOffers(decisionScopes: [decisionScope]) { offersDict, _ in
4
5
// handle response
6
if let offers = offersDict[decisionScope] {
7
let offer = offers[0]
8
// render the offer with offer.content
9
}
10
}
Copied!

Listen for offer update

Offer prefetch can not only be triggered by the aforementioned prefetchOffers API, calling Edge.sendEvent() or using Rules are alternate approaches to prefetch offers. AEP Offer Decisioning extension is listening for all the responses from Offer Decisioning Services, no matter how the requests are triggered.
The app can register a listener for offer update, so it is notified whenever there are new offers being cached or updated.
iOS — Swift

Swift

1
OfferDecisioning.onOfferUpdate { offersDict in
2
// handle offers
3
print("(propositions as AnyObject)")
4
}
Copied!
Last modified 3mo ago