Skip to main content

Use dynamic decision model data in the API response

Abstract

Describes how to include dynamic decision model data in the API response (Sitecore Personalize).

If a web experiment is configured with a decision model, you must include offers or content from the decision model in the API response. On the Data tab, you can copy an attribute or path from the decision model response and paste it in as FreeMarker into the API editor. For example, you can copy Offer name and Offer URL and paste them into the API editor window.

To include dynamic decision model data in the API response:

  1. On the Data tab, to insert dynamic data into HTML, in the Data Selector search box, enter a guest's email address to search. This enables you to access data model attributes and paths.

    Tip

    If there is a guest whose data you often use when configuring or testing code, click the star icon to bookmark the guest so you no longer have to search for them.

  2. Under Decision Model Response, click the copy icon adjacent to the attribute or path and click Copy Path as FreeMarker.

    apiresponse_data__1_.png
  3. Paste into the API editor.

  4. You must reference this data again by pasting it into the relevant HTML, CSS, or JavaScript editor.