Integrate Adobe Audience Manager with Adobe I/O for Cross-Platform Targeting
These instructions describe how to to implement cross-platform targeting solutions with Adobe Experience Cloud and Adobe I/O products integration. The solution uses below Adobe products:
An anonymous user visits a retail website. The user visits the product page, selects a color and size of the product and adds the product into the cart. The user proceeds to checkout but before completing the transaction, leaves the website, abandoning the cart. The cart abandonment activity is captured in Adobe Audience Manager segment and the user profile is served on multiple platforms to create personalized experiences.
The following diagram shows the architecture for this solution:
To complete this solution, you will need authorization to use the following services:
- Adobe Launch
- Adobe Analytics/Triggers
- Adobe I/O Events
- Adobe I/O Runtime
- Adobe Audience Manager APIs
- Adobe Audience Manager
- Adobe Target-Experience Targeting
To set up Adobe products for this solution:
To set up Launch:
-
On www.launch.adobe.com, click New Property.
-
On the Create Property box, provide the details for the new property and click Save.
-
Click the Extensions tab and install the following extensions
- Target
- Analytics
- ContextHub
- Core
- Experience Cloud ID Service
-
Click the Rules tab and create a Target rule with the following specifications:
-
Similarly, create an Analytics rule with the following specifications:
-
For the Adobe Analytics - Set Variables action, click the </> Open Editor button at the bottom of the page and add the following custom script:
var cart=ContextHub.getItem("cart");
var profile=ContextHub.getItem("profile");
var price=[];
var items=[];
for(i=0;i<cart.entries.length;i++)
{
price[i]=cart.entries[i].price;
items[i]=cart.entries[i].title;
}
s.eVar4=price.join("|");
s.eVar5=items.join("|");
s.eVar8=_satellite.getVisitorId().getAudienceManagerLocationHint();
-
Click the Environments tab and create the following environments:
-
Save the rule and then click the Publishing tab.
-
Click Add New Library button.
-
On the Create New Library form, specify a Name for the build and then select Dev (development) from the Environment drop down.
-
Click the Add All Changed Resources button.
-
Under Development, select Build for Development in the library drop down.
-
Approve and publish the library by selecting the appropriate option under the drop down arrow for each phase of the build workflow (Submitted and Approved).
-
Repeat this process for the Stage and Production environments as well.
-
The last step in the workflow is to select Build and Publish to Production on the drop down arrow under Approved.
Triggers is a Marketing Cloud Activation core service that enables marketers to identify, define, and monitor key consumer behaviors, and then generate cross-solution communication to re-engage visitors. You can use triggers in real-time decisions and personalization.
For instructions on setting up Analytics Triggers, see Specifying a New Trigger.
To set up Triggers for this solution:
-
Create a cart abandonment Triggers rule.
-
Add the following dimensions:
- Custom eVar 3
- Custom eVar 4
- Custom eVar 5
- Custom eVar 6
- Custom eVar 7
- Custom eVar 8
-
To enable these dimensions in your report suite:
On Analytics Admin screen, click Report Suites.
-
Select a report suite and then select Edit Settings > Conversion > Conversion Variables.
-
Click Add New and then select the Status checkbox. Select Enabled from the drop-down menu and then click Save.
-
Add as many conversion variables as you need. It may take some time for them to appear on the Trigger dimensions screen.
-
In this solution, you can deploy the following script to handle Triggers I/O Events and to provide updates to the visitor profile in Customer Attributes via Target Profile APIs.
webhook.js
var request = require('request');
function main(args) {
var method = args.__ow_method;
if (method == "get") {
var res = args.__ow_query.split("challenge=");
var challenge = res[1];
if (challenge)
console.log("got challenge: " + challenge);
else
console.log("no challenge");
return {
body: challenge
}
}
if (method == "post") {
try{
var body = new Buffer(args.__ow_body, 'base64');
console.log("Message Body:"+body);
var jSon = JSON.parse(body);
var mcId = jSon.event["com.adobe.mcloud.pipeline.pipelineMessage"]["com.adobe.mcloud.protocol.trigger"].mcId;
var index = jSon.event["com.adobe.mcloud.pipeline.pipelineMessage"]["com.adobe.mcloud.protocol.trigger"].enrichments.analyticsHitSummary.dimensions.eVar5.data.length - 1;
var trPrices = jSon.event["com.adobe.mcloud.pipeline.pipelineMessage"]["com.adobe.mcloud.protocol.trigger"].enrichments.analyticsHitSummary.dimensions.eVar4.data[index];
var trProducts = jSon.event["com.adobe.mcloud.pipeline.pipelineMessage"]["com.adobe.mcloud.protocol.trigger"].enrichments.analyticsHitSummary.dimensions.eVar5.data[index];
var dcs_region = jSon.event["com.adobe.mcloud.pipeline.pipelineMessage"]["com.adobe.mcloud.protocol.trigger"].enrichments.analyticsHitSummary.dimensions.eVar8.data[index];
var url = 'http://adobeiosolutionsdemo.demdex.net/event?trProducts='+trProducts+'&trPrices='+trPrices+'&d_mid='+mcId+'&d_orgid=C74F69D7594880280A495D09@AdobeOrg&d_rtbd=json&d_jsonv=1&dcs_region='+dcs_region;
console.log("Calling AAM API with:"+url);
return new Promise(function(resolve, reject) {
request.get(url, function(error, response, body) {
if (error) {
reject(error);
}
else {
resolve({body: response});
}
});
});
}catch(e){
console.log("Error occured while calling the API",e);
}
}
}
To deploy the webhook.js and create a web action, enter the following commands:
wsk action create aam webhook.js
wsk action update aam --web raw
After entering the commands, the web action is accessible at the following location:
https://runtime-preview.adobe.io/api/v1/web/<your_openwhisk_namespace>/default/aam
To set up Adobe I/O Events:
-
After signing in to the Adobe I/O Console, click New Integration.
-
Select Receive real-time events and click Continue.
-
Select Analytics Triggers as an event provider and click Continue.
-
Click Continue to move on to the next page without making any changes.
-
Provide the Name and Description for your integration.
-
Generate a public certificate. To do this:
-
On the Webhook Details form, add details, including your web action URL for I/O Events integration webhook. This is where Triggers messages will be delivered by I/O Events. Click Save.
For more information on creating and registering webhooks, see Introduction to Webhooks.
Adobe Audience Manager is a data management platform (DMP) that helps you build unique audience profiles so you can identify your most valuable segments and use them across any digital channel.
To set up Audience Manager:
-
In Audience Manager, click Manage Data.
-
Click Traits.
-
Create a new Trait with the Expression Builder, as shown:
-
Click Segments and create a new Segment as shown below. Make sure you choose the correct report suite. Select the trait that you created in the previous step.
-
Click Destinations and create a new destination as shown below.
-
Choose the Browser platform.
-
Add the segment created in the previous step in segment mapping.
-
Save the changes.
To set up Target:
-
Click Launch on the Target product card.
-
On the Activities tab, click Create Activity and select Experience Targeting.
-
On the Create Experience Targeting Activity form, provide the target page URL.
-
On the Create Experience Targeting Activity form, provide the Target page URL.
-
Open the text editor to add a custom UI element for the user on the site. To do this, select an empty container and click Edit Text/HTML.
-
On the text editor, click the HTML button, paste the following HTML and click Save.
-
Click Next and then click Change Audience.
-
On the Choose Audience screen, select the Trigger-segment audience by aam-integration-user. This is the same segment that we created in Adobe Audience Manager.
Note: If this segment doesn't appear in your target then please make sure that "Shared Audiences" is [enabled for your organization] (https://adobe.allegiancetech.com/cgi-bin/qwebcorporate.dll?idx=X8SVES).
To watch the solution work, you can test the cart abandonment scenario:
-
At http://localhost:4502/content/we-retail/us/en/products/men.html, click on a product you want to test.
-
Select a Color and Size, then click the ADD TO CART button and Checkout.
-
Enter details on the ORDER form and then click CONTINUE.
-
Close the browser tab to simulate the cart abandonment scenario.
-
On the Triggers UI page, watch for your specified trigger event to appear.
-
On the Command Line Interface (CLI) enter the following commands:
wsk activation list runtime
-
Select and copy the first activation listed and paste it into the following command:
wsk activation get f6f5ae1dcb3d4292991d63f22283fb94
-
View the Products site page to see the custom UI element you created.
- Hiren Shah @hirenshah111.
Please help make this solution as useful as possible. If you find a problem in the documentation or have a suggestion, click the Issues tab on this GiHhub repository and then click the New issue button. Provide a title and description for your comment and then click the Submit new issue button.