Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

The availability of features may depend on your plan type. Contact your Customer Success Manager if you have any questions.

Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideLegal TermsGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

HTML

This topic describes the HTML box in the Extension Builder.

The body of the extension can be written in the HTML box. You can write any HTML here and then decide where it gets injected in the Apply JS section. In addition to vanilla HTML, you can use mustache syntax to add more advanced logic like loops and conditionals.

You can reference field values by using the API name on the extension object like {{ extension.title }}. For nonescaped values like an HTML or rich text field, use triple brackets like {{{ extension.contents }}}.

<div class="banner" style="background-color: {{extension.color}}">
  {{{ extension.text }}}.
  <a href="{{extension.link}}">{{{ extension.link_text }}}</a>
</div>

Next