Embed quizzes and widgets in HTML

To embed a widget in HTML, you paste one empty tag where it should appear. Paste one empty <div> where the quiz or widget should appear. The tracking script finds it and fills it in, and later edits show up without changing the code.

On this pageEmbed a quizEmbed a widgetWhere to paste it, by platformOn a page without the tracking scriptIn a React component

Updated November 28, 2026

Both need the CROforce tracking script on the page — see Install the tracking script. The app gives you the exact code; this page explains it.

Embed a quiz

HTML
<div data-entail-quiz="YOUR_QUIZ_ID"></div>

To get the code with your quiz's ID already in it:

  1. Open the quiz and go to the Share tab.
  2. Under How you add this quiz, choose Embed it yourself.
  3. Under How the quiz shows, open Display and pick a display style: Inline, Popup or Full screen.
  4. Click Save Settings. Get Code becomes available once the choice is saved.
  5. Click Get Code, choose your platform in Embed Your Quiz, and click Copy Code.

How the quiz shows

What appears where you put the tag

Inline

The quiz itself, inside your page's content.

Popup, Full screen

A button. Clicking it opens the quiz as a popup or over the whole screen.

Publish the quiz first. The code shows the quiz only once it's live. Until then the tag stays empty.

More about quiz placement: Show or embed a quiz.

Embed a widget

HTML
<div class="entail-ai-widget-YOUR_WIDGET_ID" entail-widget-id="YOUR_WIDGET_ID"></div>

The widget's ID appears twice: in the class and in entail-widget-id. Copy the code from the widget instead of typing it: once the widget is live, open Add to Your Site in the widget builder and click Copy Code. See Add a widget to your site.

  • Inline widgets and forms need this code.
  • Popups and bars don't — the tracking script shows them on the pages you chose on their Display tab.
  • To place widgets on many pages without editing them, use a campaign instead.

Lazy loading

Widgets placed in your HTML load when they come within 300 pixels of the screen, so a widget far down the page doesn't slow down the top. To load one right away, add entail-widget-lazy-load="false":

HTML
<div class="entail-ai-widget-YOUR_WIDGET_ID" entail-widget-id="YOUR_WIDGET_ID" entail-widget-lazy-load="false"></div>

To load every widget right away, pass lazyload: false in init options.

Where to paste it, by platform

Platform

Where the tag goes

WordPress

A Custom HTML block where you want it, then Update.

Shopify

In the theme editor, add a Custom Liquid section where you want it.

Webflow

An Embed element where you want it, then publish the site.

Any other website

Your page's HTML, where you want it.

React, Next.js and other apps

Render the same <div> from a component. The script also finds tags added after the page has loaded.

Wix isn't supported for embeds. Wix's Embed Code element runs in a sandboxed frame that the tracking script can't fill. Show the quiz with CROforce's own targeting instead.

On a page without the tracking script

The Embed Your Quiz and Add to Your Site dialogs include the tracking script too, under Add Entail to your website. Add it once to your whole site's <head>; the tag alone does nothing.

In a React component

JSX
export function ProductQuiz() {
  // The tracking script fills the div in, including after a route change.
  return <div data-entail-quiz="YOUR_QUIZ_ID" />;
}

Frequently asked questions

Why is my embedded quiz empty?

The quiz isn't live yet, the page doesn't load the CROforce tracking script, or the quiz ID in the code is wrong. The code shows the quiz only once it's published.

Do I need to update the code when I edit the quiz or widget?

No. The tag only holds the ID. Saved changes show wherever you've pasted it.

Can I embed a popup or a notification bar this way?

You don't need to. Popups and bars are shown by the tracking script on the pages you choose in their Display settings, with no code to paste.

Was this article helpful?

Try it on your own site

Add a popup, form or quiz to your site in a few minutes and see what it does for your conversions.