Home Guides Tilda

How to add a quiz to a Tilda website

Copy the LeadForms code
In the quiz editor, open “Publish” → “On website” and expand the “Site code” block. Copy the code, which looks like this: <script async src="https://script.leadforms.org/v1.js" data-key="YOUR_KEY"></script>. Your key is already filled in.
It is one code for the whole site: it loads all your quizzes and widgets. If the code is already installed, the block is called “LeadForms code found on your website”: you do not need to paste it again, go straight to the “Choose how to show the quiz” step.
“Publish” → “On website” tab in LeadForms: the “Site code” block with the code to paste
Add a new block
Open the Tilda editor and add an “Other / HTML code” block
Tilda editor: adding the “Other / HTML code” block
Paste the code
Open the content of the block you just added, paste the LeadForms code and save. The code has to be on every page where the quiz should work: if you have several pages, add this block to each of them.
Note that the HTML code block only works on paid Tilda plans. In other words, for the quiz to work you need a Tilda Personal or Tilda Business plan.
HTML code block in Tilda: field for the LeadForms code
Choose how to show the quiz and click “Publish”
Go back to LeadForms, to the “Publish” → “On website” tab. In the “Where the quiz appears” step, choose “Window over the site” or “Side panel”, and in the “How it opens” step choose, for example, “LeadForms button: in the corner or as a banner” or “Auto-open”. You can pick several at once. This is also where you choose the devices and pages that show the quiz.
If you want the LeadForms button inside a section of the page, choose “Button on the page” and paste its code <div data-leadforms-button="ID"></div> into an “Other / HTML code” block right where the button should be (replace ID with your quiz number).
Click the “Publish” button at the bottom of the tab. Until you do, the changes will not reach your site.
“Publish” → “On website” tab in LeadForms: the “Where the quiz appears” and “How it opens” steps and the “Publish” button
Publish the page
Tilda: publishing the page
If you want to open the quiz with a Tilda button
The LeadForms code still has to be on the page: paste it as in steps 1–3 above. If it is already there, you do not need to paste it again.
Get the quiz link from “Your website’s links and buttons”
In LeadForms, on the “Publish” → “On website” tab, in the “How it opens” step, expand “Your website’s links and buttons” and copy the link. These links always work: there is nothing extra to turn on or publish. The quiz will open from any button or link on your site that points to #leadforms-ID, where ID is your quiz number.
“Publish” in LeadForms: the “Your website’s links and buttons” option and the #leadforms-ID link
Add the button
Add a block with a button from the Tilda block library, any one from the forms and buttons section, and open “Content”.
Tilda block library: a button block from the forms and buttons section
Enter the quiz link
In the “Button link” field, enter #leadforms-ID, replacing ID with your quiz number. Then save.
Button settings in Tilda: “Button link” field
Publish the page
Your quiz is now live on your Tilda website.
Tilda: published page with the quiz button
If the quiz should sit right on the page
You can show the quiz as a block inside a section of your site, with no button and no pop-up. The LeadForms code is needed here too, as in steps 1–3 above.
Choose “Block in the page”
In LeadForms, on the “Publish” → “On website” tab, in the “Where the quiz appears” step, choose “Block in the page” and click “Publish”.
“Publish” in LeadForms: the “Block in the page” option and its code
Paste the block code
In Tilda, add an “Other / HTML code” block where the quiz should be and paste <div data-leadforms-block="ID"></div> into it, replacing ID with your quiz number. Save and publish the page.
Having trouble with the setup?
If something doesn't work, and we'll sort it out with you.

Still have questions? Write to us

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