Home Guides Wix

How to add a quiz to a Wix website

To put the quiz on Wix, you only need a few steps:
How it works
You paste the LeadForms code into Wix once, and it covers every page. How the quiz shows up is something you choose in LeadForms, on the “Publish” tab: the LeadForms button in the corner or as a banner, auto-open (after a delay, when the visitor shows interest or when they are about to leave the page) and other options. You no longer need a second code for each option.
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
In Wix, open “Settings” → “Custom Code”
In your site’s dashboard, go to “Settings” and, in the “Development & integrations” section, choose “Custom Code”. Code added there goes on every page of the site at once.
Learn more about custom code in the Wix Help Center.
Wix settings: the “Custom Code” section
Click “Add Custom Code”
Code can go in the head or in the body of your pages. Put the LeadForms code at the end of the body (it also works in the head). Click “+ Add Custom Code” at the top right.
“Custom Code” section in Wix: the head and body areas and the button for adding code
Paste the code and choose “Body - end”
Paste the LeadForms code into the text box and give it a clear name, for example “LeadForms code”.
Under “Add Code to Pages”, choose “All pages”, and under “Place Code in”, choose Body - end. Click “Apply”.
You will not need to paste any more code: your next quizzes and widgets load through this same code.
Wix window for adding custom code, with the LeadForms code pasted in
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.
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
Leave the settings: “Site Actions” → “Edit Site”
The code is in place; now you need to go back to the editor. In the dashboard, click “Site Actions” and choose “Edit Site”.
Wix dashboard: the “Site Actions” menu and the “Edit Site” option
Publish your Wix site
The “Publish” button is at the top right of the Wix editor. Until the site is published, the changes are only visible there.
Done! The quiz is in place. To check the setup, go to LeadForms, click “Check page” in the “Site code” block and enter your site’s address.
Wix editor: the “Publish” button at the top right
More quizzes and changing how they show
You do not need to touch the code in Wix again. To change how the quiz shows up (for example, to turn on auto-open) or to add another quiz to your site, set it up on the “Publish” → “On website” tab and click “Publish”.
Stuck with the setup?
If something does not work, and we will 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