Use Adobe Target and Web SDK for personalization

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.

IMPORTANT
Learn how to migrate your Target implementation to Platform Web SDK with the Migrate Target from at.js 2.x to Platform Web SDK tutorial.
Learn how to implement Target for the first time with the Implement Adobe Experience Cloud with Web SDK tutorial. For information specific to Target, see the tutorial section titled Set up Target with Platform Web SDK.

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

Web SDK system diagram

The following diagram helps you understand the workflow of Target and Web SDK edge decisioning.

Diagram of Adobe Target edge decisioning with the Platform Web SDK

Call
Details
1
The device loads the Web SDK. The Web SDK sends a request to the edge network with XDM data, the Datastreams Environment ID, passed-in parameters, and the Customer ID (optional). Page (or containers) is pre-hidden.
2
The edge network sends the request to the edge services to enrich it with the Visitor ID, consent, and other visitor context info, such as geolocation and device-friendly names.
3
The edge network sends the enriched personalization request to the Target edge with the Visitor ID and passed-in parameters.
4
Profile scripts execute and then feed into Target profile storage. Profile storage fetches segments from the Audience Library (for example, segments shared from Adobe Analytics, Adobe Audience Manager, the Adobe Experience Platform).
5
Based on URL request parameters and profile data, Target determines which activities and experiences to display for the visitor for the current page view and for future prefetched views. Target then sends this back to the edge network.
6
a. The edge network sends the personalization response back to the page, optionally including profile values for additional personalization. Personalized content on the current page is revealed as quickly as possible without flicker of default content.
b. Personalized content for views that are shown as a result of user actions in a Single Page Application (SPA) is cached so it can be instantly applied without an additional server call when the views are triggered.
. The Edge Network sends the Visitor ID and other values in cookies, such as consent, Session ID, identity, cookie check, personalization.
7
The edge network forwards Analytics for Target (A4T) details (activity, experience, and conversion metadata) to the Analytics edge.

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 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.

Rendering personalized content

See Rendering personalization content for more information.

Audiences in XDM

When defining audiences for your Target activities that are delivered via the 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 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.

Response tokens

Response tokens are used to send metadata to third parties like Google or Facebook. Response tokens are returned
in the meta field within propositions -> items. Here is a sample:

{
  "id": "AT:eyJhY3Rpdml0eUlkIjoiMTI2NzM2IiwiZXhwZXJpZW5jZUlkIjoiMCJ9",
  "scope": "__view__",
  "scopeDetails": ...,
  "renderAttempted": true,
  "items": [
    {
      "id": "0",
      "schema": "https://ns.adobe.com/personalization/dom-action",
      "meta": {
        "experience.id": "0",
        "activity.id": "126736",
        "offer.name": "Default Content",
        "offer.id": "0"
      }
    }
  ]
}

To collect the response tokens, you have to subscribe to alloy.sendEvent promise, iterate through propositions, and extract the details from items -> meta.

Every proposition has a renderAttempted boolean field indicating whether the proposition was rendered or not. See the sample below:

alloy("sendEvent",
  {
    renderDecisions: true,
    decisionScopes: [
      "hero-container"
    ]
  }).then(result => {
    const { propositions } = result;

    // filter rendered propositions
    const renderedPropositions = propositions.filter(proposition => proposition.renderAttempted === true);

    // collect the item metadata that represents the response tokens
    const collectMetaData = (items) => {
      return items.filter(item => item.meta !== undefined).map(item => item.meta);
    }

    const pageLoadResponseTokens = renderedPropositions
      .map(proposition => collectMetaData(proposition.items))
      .filter(e => e.length > 0)
      .flatMap(e => e);
  });

When automatic rendering is enabled, propositions array contains:

On Page-Load:

  • Form-Based Composer based propositions with renderAttempted flag set to false
  • Visual Experience Composer based propositions with renderAttempted flag set to true
  • Visual Experience Composer based propositions for a Single Page Application view with renderAttempted flag set to true

On View - change (for cached views):

  • Visual Experience Composer based propositions for a Single Page Application view with renderAttempted flag set to true

When automatic rendering is disabled, propositions array contains:

On Page-Load:

  • Form-based Composer-based propositions with renderAttempted flag set to false
  • Visual Experience Composer-based propositions with renderAttempted flag set to false
  • Visual Experience Composer-based propositions for a Single Page Application view with renderAttempted flag set to false

On View - change (for cached views):

  • Visual Experience Composer-based propositions for a Single Page Application view with renderAttempted flag set to false

Single profile update

The Web SDK lets you update the profile to the Target profile and to the 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."
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 lands in Web SDK as an experience event
data
Object
Arbitrary key/value pairs sent to Target solutions under the target class.

Typical 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 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 Web SDK debugging.

Terminology

Propositions: In Adobe Target, propositions correlate to the experience that is selected from an Activity.

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

Scope: The scope of the decision. In Adobe 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 Adobe Target as mBox parameters.

recommendation-more-help
def05a9c-d048-422c-a3a1-88b2de863f4f