Skip to main content

Using custom code in a web experiment variant

Abstract

Overview of how to use custom code in a web experiment variant to apply personalization (Sitecore Personalize).

To apply personalization to a web experiment, you can use HTML, CSS, or JavaScript in a variant. When Sitecore Personalize runs for a web experiment, it executes any HTML, CSS, or JavaScript configured in the variant.

In order for personalization to work, the variant must pass any guest data to your organisation's website, for example the guest's first name, location, loyalty number, etc. This information is known as server-side data. To facilitate, you must compose the API response using FreeMarker, then reference it in the relevant HTML, CSS, or JavaScript editor.