Show Menu
TOPICS×

Overview of Personalization Options

The Adobe Experience Platform Web SDK supports querying the personalization solutions at Adobe including Adobe Target. There are two modes for personalization: retrieving content that can be rendered automatically and content that the developer must render. The SDK also provides facilities to manage flicker .

Automatically Rendering Content

The SDK automatically renders personalized content when you send an event to the server and set renderDecisions to true as an option on the event.
alloy("sendEvent", {
  "renderDecisions": true,
  "xdm": {
    "commerce": {
      "order": {
        "purchaseID": "a8g784hjq1mnp3",
        "purchaseOrderNumber": "VAU3123",
        "currencyCode": "USD",
        "priceTotal": 999.98
      }
    }
  }
});

The rendering of personalized content is asynchronous, so there should not be any assumption around when a particular piece of content is part of the page.

Manually Rendering Content

You can request the list of decisions to be returned as a promise on the event command by using scopes . A scope is a string the lets the personalization solution know which decision you would like.
alloy("sendEvent",{
    xdm:{...},
    scopes:['demo-1', 'demo-2']
  }).then(function(result){
    if (result.decisions){
      //do something with the decisions
    }
  })

This will return a list of decisions as a JSON object for each decisions.

{
  "decisions": [
    {
      "id": "TNT:123456:0",
      "scope": "demo-1",
      "items": [
        {
          "schema": "https://ns.adobe.com/personalization/html-content-item",
          "data": {
            "id": "11223344",
            "content": "<h2 style=\"color: yellow\">Scoped Decision for location \"alloy-location-1\"</h2>"
          }
        }
      ]
    },
    {
      "id": "TNT:654321:1",
      "scope": "demo-2",
      "items": [
        {
          "schema": "https://ns.adobe.com/personalization/json-content-item",
          "data": {
            "id": "4433221",
            "content": {
              "name":"Scoped decision in JSON"
            }
          }
        }
      ]
    }
  ]
}


If you use Target scopes become mBoxes on the server, only they are all requests at once instead of individually. The global mbox is always sent.

Retrieve Automatic Content

If you would like the result.decisions to include the automatic renderable decisions you can set renderDecisions to false and include the special scope __view__