Use HTML in a web experiment


Describes how to use HTML in a web experience to use dynamic data (Sitecore Personalize).

A useful way to insert dynamic data on a website and facilitate 1:1 personalization is including HTML in a web experiment.

To use HTML in a web experience:

  1. On the Build screen, on the Personalization tile, click Add. The Create Variant sliding modal displays.

  2. Click the Add custom code link.

  3. In the template editor, on the HTML tab, enter any HTML that you want to use in the web experience.

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


    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.

  5. To include dynamic data from the decision model response, expand the Decision Model Response tree and click copy, Copy Path as Handlebars.

  6. To include dynamic data from the experience response, expand the Experience Response tree and click copy, Copy Path as Handlebars.

  7. On the HTML tab, paste the data and click Save.

  8. Click Close. You return to the Build screen.

    You must also include the dynamic data when you compose the API response. This ensures that when the experience executes, the server requests the dynamic data and passes it to the variant.