Using Adobe Target with the Platform Web SDK

Adobe Experience Platform Web SDK can deliver and render personalized experiences managed in Adobe Target to the web channel. You can use a WYSIWYG editor, called the Visual Experience Composer (VEC), or a non-visual interface, the Form-based Experience Composer, to create, activate, and deliver your activities and personalization experiences.

The following features have been tested and are currently supported in Target:

Enabling Adobe Target

To enable Target, do the following:

  1. Enable Target in your datastream with the appropriate client code.
  2. Add the renderDecisions option to your events.

Then, optionally, you can also add the following options:

  • decisionScopes: Retrieve specific activities (useful for activities created with the form-based composer) by adding this option to your events.
  • Prehiding snippet: Hide only certain portions of the page.

Using the Adobe Target VEC

To use the VEC with a Platform Web SDK implementation, install and activate either the Firefox or Chrome VEC Helper Extension.

For more information, see Visual Experience Composer helper extension in the Adobe Target guide.

Auto-render VEC Activities

The Adobe Experience Platform Web SDK has the power to automatically render your experiences defined via Adobe Target’s VEC on the web for your users. In order to indicate to Experience Platform Web SDK to auto-render VEC activities, send an event with renderDecisions = true:

alloy
("sendEvent", 
  { 
  "renderDecisions": true, 
  "xdm": {
    "commerce": { 
      "order": {
        "purchaseID": "a8g784hjq1mnp3", 
         "purchaseOrderNumber": "VAU3123", 
         "currencyCode": "USD", 
         "priceTotal": 999.98 
         } 
      } 
    }
  }
);

Using the Form-Based Composer

The Form-Based Experience Composer is a non-visual interface that’s useful for configuring A/B Tests, Experience Targeting, Automated Personalization, and Recommendations activities with different response types, such as JSON, HTML, Image, etc. Depending on the response type or decision returned by Target, your core business logic can be executed. To retrieve decisions for your Form-Based Composer activities, send an event with all ‘decisionScopes’ you want to retrieve a decision for.

alloy
  ("sendEvent", { 
    decisionScopes: [
      "foo", "bar"], 
      "xdm": {
        "commerce": { 
          "order": { 
            "purchaseID": "a8g784hjq1mnp3", 
            "purchaseOrderNumber": "VAU3123", 
            "currencyCode": "USD", 
            "priceTotal": 999.98 
          } 
        } 
      } 
    }
  );

Decision Scopes

decisionScopes define sections, locations, or parts of your pages where you want to render a personalized experience. These decisionScopes are customizable and user-defined. For current [!DNL Target] customers, decisionScopes are also known as “mboxes.” In the [!DNL Target] UI, decisionScopes appear as “locations.”

The __view__ Scope

The Experience Platform Web SDK provides functionality to retrieve VEC actions without relying on the SDK to render the VEC actions for you. Send an event with __view__ defined as a decisionScopes.

alloy("sendEvent", {
      "decisionScopes": ["__view__", "foo", "bar"], 
      "xdm": { 
        "web": { 
          "webPageDetails": { 
            "name": "Home Page"
          }
        } 
      }
    }
  ).then(function(results) {
    for (decision of results.decisions) {
      if (decision.decisionScope === "__view__") {
        console.log(decision.content)
      }
    }
  });

Audiences in XDM

When defining audiences for your Target activities that are delivered via the Platform Web SDK, XDM must be defined and used. After you define XDM schemas, classes, and schema field groups, you can create a Target audience rule defined by XDM data for targeting. Within Target, XDM data displays in the Audience Builder as a custom parameter. The XDM is serialized using dot notation (for example, web.webPageDetails.name).

If you have Target activities with predefined audiences that use custom parameters or a user profile, they are not delivered correctly via the SDK. Instead of using custom parameters or the user profile, you must use XDM instead. However, there are out-of-the-box audience targeting fields supported via the Platform Web SDK that do not require XDM. These fields are available in the Target UI that do not require XDM:

  • Target Library
  • Geo
  • Network
  • Operating System
  • Site Pages
  • Browser
  • Traffic Sources
  • Time Frame

For more information, see Categories for audiences in the Adobe Target guide.

Single profile update

The Platform Web SDK lets you update the profile to the Target profile and to the Platform Web SDK as an experience event.

To update a Target profile, ensure that the profile data is passed with the following:

  • Under “data {“
  • Under “__adobe.target”
  • Prefix “profile.” e.g. as below
Key Type Description
renderDecisions Boolean Instructs the personalization component whether it should interpret DOM actions
decisionScopes Array <String> A list of scopes to retrieve decisions for
xdm Object Data formatted in XDM that land in the Platform Web SDK as an experience event
data Object Arbitrary key/value pairs sent to Target solutions under the target class.

Typical Platform Web SDK code using this command looks like the following:

sendEvent with profile data

alloy("sendEvent", {
   renderDecisions: true|false,
   xdm: { // Experience Event XDM data },
   data: { // Freeform data }
});

How to send Profile attributes to Adobe Target:

alloy("sendEvent", {
  renderDecisions: true,
  data: {
    __adobe: {
      target: {
        "profile.gender": "female",
        "profile.age": 30
      }
    }
  }
});

Request recommendations

The following table lists Recommendations attributes and whether each one is supported via the Platform Web SDK:

Category Attribute Support Status
Recommendations – Default entity attributes entity.id Supported
entity.name Supported
entity.categoryId Supported
entity.pageUrl Supported
entity.thumbnailUrl Supported
entity.message Supported
entity.value Supported
entity.inventory Supported
entity.brand Supported
entity.margin Supported
entity.event.detailsOnly Supported
Recommendations – Custom entity attributes entity.yourCustomAttributeName Supported
Recommendations – Reserved mbox/page parameters excludedIds Supported
cartIds Supported
productPurchasedId Supported
Page or item category for category affinity user.categoryId Supported

How to send Recommendations attributes to Adobe Target:

alloy("sendEvent", {
  renderDecisions: true,
  data: {
    __adobe: {
      target: {
        "entity.id" : "123",
        "entity.genre" : "Drama"
      }
    }
  }
});

Debugging

mboxTrace and mboxDebug have been deprecated. Use Platform Web SDK debugging.

Terminology

Decisions: In Target, decisions correlate to the experience that is selected from an Activity.

Schema: The schema of a decision is the type of offer in Target.

Scope: The scope of the decision. In Target, the scope is the mBox. The global mBox is the __view__ scope.

XDM: The XDM is serialized into dot notation and then put into Target as mBox parameters.

On this page