Home Blog Product How to embed a quiz on your website: a step-by-step guide

How to embed a quiz on your website: a step-by-step guide

product

Your quiz is ready, but as long as it sits in your LeadForms dashboard, it won't bring in leads. You still need to put it on your site: that's five to ten minutes and a single code snippet you add to your site once.

We'll walk through the whole path, from creating the quiz to checking that leads come in.

Step 1. Create the quiz

In your LeadForms dashboard, open the "Quizzes" section and click "Create from scratch." Next to it there are other options: "Create from template," with ready-made flows from the library, "Import quiz," and "AI quiz," if you need a draft for your niche in a minute.

The editor has four tabs: "Settings," "Editor," "Design," and "Publish." Inside "Editor" there's a step-by-step wizard: start screen → questions → contact form → results → "Thank you" page. A live preview is always visible on the right, and you can switch it between desktop and mobile.

Step 2. Add the LeadForms code to your site

Open the "Publish" tab → "On website" and expand the "Site code" block. It holds a ready-made code with your account key:

<script async src="https://script.leadforms.org/v1.js" data-key="YOUR_KEY"></script>

Paste it once, on every page of your site: before the closing </body> tag or in your site builder's field for site-wide code. There's one code per account, and it loads all your quizzes and widgets. If it's already installed, skip this step; you won't need to change the code for future quizzes either.

Step 3. Choose how to show the quiz

In the same "Publish" → "On website" tab, setup takes two steps.

  • Where the quiz appears: a window over the site, a side panel, or a block in the page. The window and the panel work when the page already has its own content and offer, and the quiz is the next step. The block is for ad landing pages where the quiz is the main content: it's embedded right in the page, with no pop-up.
  • How it opens: with the LeadForms button, auto-open, a button on the page, inside the multi-button, or with your website's own links and buttons. To open the quiz from your own button, set the button's link to #leadforms-ID, where ID is the quiz number, the same one as in the direct link.

For a block in the page, paste a short code where the quiz should go: <div data-leadforms-block="ID"></div>. The other options don't need anything added to the page: the code from step 2 is enough.

Then click "Publish" at the bottom of the tab. Without it, your changes in the "Publish" tab won't reach your site.

Step 4. Guides for your platform

Where exactly to paste the code depends on your platform. Ready-made guides with screenshots:

  • Tilda: use the "Other/HTML code" block. Note that this block only works on Tilda's paid plans.
  • WordPress: use the "Custom HTML" block.
  • Wix
  • Bitrix24 sites
  • Flexbe
  • LPmotor
  • Platforma LP
  • Taplink

Also: embedding the quiz in the page body and installing via Google Tag Manager, if you don't have access to your site's code.

Step 5. Check that everything works

Check on the published page, not in the site builder: in the platform's preview, the code often doesn't run. Your dashboard has a "Check page" button in the "Site code" block: enter the page address, and LeadForms shows whether it found the code there.

  • The quiz opens from the button or shows up inside the block.
  • It opens on a phone, not just on desktop.
  • The form submits and the lead comes in: go through the whole quiz yourself with a real number.
  • The lead arrived where it should: email, messenger, or CRM.

Set up that last point from the start so leads don't pile up in your LeadForms dashboard: for example, send quiz leads to Kommo (formerly amoCRM).

Common embedding mistakes

  • "Publish" wasn't clicked. The display option is chosen, but without the button at the bottom of the "Publish" tab it won't reach your site.
  • The code is duplicated. You need just one LeadForms code for the whole site, even with several quizzes and widgets.
  • The test was done in the builder, not on the live page. Publish the page first.
  • The quiz ended up below the fold and nobody sees it. If it's the landing page's main tool, it belongs at the top.
  • The mobile version wasn't checked. Most traffic usually comes from phones.

The code to paste comes from the LeadForms quiz builder in the "Publish" tab: all that's left is to add it to your site and choose how to show the quiz.

FAQ

Which should I choose, a window on a button or a block in the page?

A block in the page, if the page was built for the quiz and it's the main content. A window or a panel on a button, if the page has its own offer and content, and the quiz is the next step.

Can I put several quizzes on one page?

Yes. There's still one LeadForms code on the site, and the display option is set up separately for each quiz. For in-page blocks, each quiz has its own short code with its number.

What if I don't have access to my site's code?

Use the Google Tag Manager installation. Another option is not to embed the quiz at all and send traffic to a separate quiz page.

The quiz is installed but there are no leads. Is it the installation?

First check whether test leads come in. If they do, the installation isn't to blame and the cause is in the quiz itself or the traffic: we cover that in why your quiz gets traffic but few leads.

What to read next

Build a quiz for your business
Pick a ready-made template or generate a quiz with AI from a short description of your task. Your first 20 leads are free.
Create a quiz Browse templates

Was this article helpful?

Still have questions? Write to us

Name *
* Required field
Email *
* Required field
Message
Write to us!
We reply within 30 seconds