Personalization via Adobe Target
Overview overview
The Edge Network Server API can deliver and render personalized experiences created in Adobe Target, with the help of the Form-Based Experience Composer.
Configure your datastream configure-your-datastream
Before you can use the Server API in conjunction with Adobe Target, you must enable Adobe Target personalization on your datastream configuration.
See the guide on adding services to a datastream, for detailed information on how to enable Adobe Target.
When configuring your datastream, you can (optionally) provide values for Property Token, Target Environment ID, and Target Third Party ID Namespace.
Custom parameters custom-parameters
Most fields in the XDM portion of each request are serialized into dot notation and then sent to Target as custom or mbox parameters.
Example custom-parameters-example
Given the following XDM sample:
"xdm":{
"marketing":{
"campaignGroup":"winter22",
"campaignName":"homeOwnerPromo22",
"trackingCode":"hop22"
}
}
When creating audiences in Target, the following values will be available as custom parameters:
marketing.campaignGroup
marketing.campaignName
marketing.trackingCode
Target profile updates profile-update
The Server API allows for updates to the Target profile. To update a Target profile, ensure that the profile data is passed in the data
portion of the request in the following format:
"data": {
"__adobe.target": {
"profile.eyeColor": "brown",
"profile.hairColor": "brown"
}
}
Querying Target activities querying-target-activities
Schemas schemas
The query portion of the request determines what content is returned by Target. Under the personalization
object, schemas
determines the type of content to be returned by Target.
In situations where you are unsure of what sort of offers you’ll be retrieving, you should include all four of the schemas in your personalization query to the Edge Network:
- HTML-based offers:
https://ns.adobe.com/personalization/html-content-item - JSON-based offers:
https://ns.adobe.com/personalization/json-content-item - Target Redirect offers
https://ns.adobe.com/personalization/redirect-item - Target DOM Manipulation offers
https://ns.adobe.com/personalization/dom-action
Decision scopes decision-scopes
Adobe Target mbox names should be included in the decisionScopes
array to return the appropriate content.
Example decision-scopes-example
In the example below, all four offer types are requested along with a Target activity called serverapimbox
.
"query":{
"personalization":{
"schemas":[
"https://ns.adobe.com/personalization/html-content-item",
"https://ns.adobe.com/personalization/json-content-item",
"https://ns.adobe.com/personalization/redirect-item",
"https://ns.adobe.com/personalization/dom-action"
],
"decisionScopes":[
"serverapimbox"
]
}
}
API call example api-example
API format
POST /ee/v2/interact
Request request
A full request that includes a complete XDM object, profile paramters, along with the appropriate Target query is outlined below.
curl -X POST 'https://server.adobedc.net/ee/v2/interact?dataStreamId={DATASTREAM_ID}' \
--header 'x-api-key: {API_KEY}' \
--header 'x-gw-ims-org: {ORG_ID}' \
--header 'Authorization: Bearer {TOKEN}' \
--header 'Content-Type: application/json' \
--data-raw '{
"event": {
"xdm": {
"eventType": "web.webpagedetails.pageViews",
"identityMap": {
"ECID": [
{
"id": "05907638112924484241029082405297151763",
"authenticatedState": "ambiguous",
"primary": true
}
]
},
"web": {
"webPageDetails": {
"URL": "https://alloystore.dev",
"name": "Home Page"
},
"webReferrer": {
"URL": ""
}
},
"device": {
"screenHeight": 1440,
"screenWidth": 3440,
"screenOrientation": "landscape"
},
"environment": {
"type": "browser",
"browserDetails": {
"viewportWidth": 3440,
"viewportHeight": 1440
}
},
"placeContext": {
"localTime": "2022-03-22T22:45:21.193-06:00",
"localTimezoneOffset": 360
},
"timestamp": "2022-03-23T04:45:21.193Z",
"implementationDetails": {
"name": "https://ns.adobe.com/experience/alloy/reactor",
"version": "1.0",
"environment": "serverapi"
},
"data": {
"__adobe": {
"target": {
"profile.eyeColor": "brown",
"profile.hairColor": "brown",
"profile.shoeColor": "black"
}
}
}
}
},
"query": {
"personalization": {
"schemas": [
"https://ns.adobe.com/personalization/html-content-item",
"https://ns.adobe.com/personalization/json-content-item",
"https://ns.adobe.com/personalization/redirect-item",
"https://ns.adobe.com/personalization/dom-action"
],
"decisionScopes": [
"serverapimbox"
]
}
}
}'
Response response
The Edge Network will return a response similar to the one below.
{
"requestId":"10959bbf-f83d-40e1-9521-d9145f19cdc5",
"handle":[
{
"payload":[
{
"id":"AT:eyJhY3Rpdml0eUlkIjoiMTQwMjgxIiwiZXhwZXJpZW5jZUlkIjoiMCJ9",
"scope":"serverapimbox",
"scopeDetails":{
"decisionProvider":"TGT",
"activity":{
"id":"140281"
},
"experience":{
"id":"0"
},
"strategies":[
{
"algorithmID":"0",
"trafficType":"0"
}
],
"characteristics":{
"eventToken":"xycjBJlZhwVV5MN0kMkmoGqipfsIHvVzTQxHolz2IpTMromRrB5ztP5VMxjHbs7c6qPG9UF4rvQTJZniWgqbOw=="
}
},
"items":[
{
"id":"282484",
"schema":"https://ns.adobe.com/personalization/json-content-item",
"meta":{
"offer.name":"/server_apiform/experiences/0/pages/0/zones/0/1648103551041",
"experience.id":"0",
"activity.name":"Server API Form",
"activity.id":"140281",
"experience.name":"Experience A",
"option.id":"2",
"offer.id":"282484"
},
"data":{
"id":"282484",
"format":"application/json",
"content":{
"value":"a/b json experience a",
"platform":"server"
}
}
}
]
}
],
"type":"personalization:decisions",
"eventIndex":0
},
{
"payload":[
{
"key":"kndctr_53A16ACB5CC1D3760A495C99_AdobeOrg_identity",
"value":"CiYwNTkwNzYzODExMjkyNDQ4NDI0MTAyOTA4MjQwNTI5NzE1MTc2M1IOCL-pwpv9LxgBKgNPUjLwAb-pwpv9Lw==",
"maxAge":34128000
}
],
"type":"state:store"
}
]
}
If the visitor qualifies for a personalization activity based on the data sent to Adobe Target, the relevant activity content will be found under the handle
object, where the type is personalization:decisions
.
Other content will sometimes be returned under handle
as well. Other content types are not relevant to the Target personalization. If the visitor qualifies for multiple activities, each activity will be a separate personalization
object in the array.
The table below explains the key elements of that portion of the response.
scope
"scope": "serverapimbox"
items[].schema
"schema": "https://ns.adobe.com/personalization/json-content-item",
items[].meta.activity.id
"activity.id": "140281"
items[].meta.activity.name
"activity.name": "Server API Form"
items[].meta.experience.id
"experience.id": "0"
items[].meta.experience.name
"experience.name": "Experience A"
items[].data.id
"id": "282484"
items[].data.format
"format: "application/json
items[].data.content
"content": "<CONTENT CONFIGURED IN TARGET>"
Server-side personalization sample application sample
The sample application found at this URL demonstrates using Adobe Experience Platform to get personalization content from Adobe Target. The web page changes based on the personalization content returned.
This sample does not rely on client-side libraries like the Web SDK to get personalization content. Instead, it uses the Adobe Experience Platform APIs to fetch personalization content. Then the implementation generates the HTML server-side based on the personalization content returned.