Skip to main content

Using custom code in a web experience variant


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

To apply personalization to a web experience , you can use HTML, CSS, or JavaScript in a variant. When Sitecore Personalize runs for a web experience, 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.