Products / Lead Quiz / Docs

Evergreen Lead Quiz

A short quiz on your website that turns visitors into sorted, ready-to-call leads.

Visitors answer a few multiple-choice questions, enter their name and email (and phone if you want it), and see a personal result straight away. You get the lead with their answers, a score and a Hot / Warm / Cold rating, so you know who to call first.

It works anywhere you can paste a block of HTML: Squarespace, WordPress, Wix, Webflow, Shopify (Online Store 2.0 themes), Ghost, Carrd and plain HTML pages. It isn't tied to one industry. Templates are included for home sellers, home buyers, wellness and service businesses, and you can write your own in a spreadsheet.

  • Write the quiz in a spreadsheet. Questions, answers, points, results and settings are rows in a Google Sheet or CSV file. Change a row and the quiz on your site changes.
  • Scores and ratings. Each answer has points. The total picks the result the visitor sees and the rating you see.
  • Tags. Give answers a tag like timeline:0-3 months and every lead arrives labeled, ready to filter or send to your CRM.
  • Free lead automation with Google Sheets. The included script (apps-script/LeadQuiz.gs) runs in your own Google account, at no cost:
    • saves every lead to a spreadsheet
    • emails you an alert, with πŸ”₯ HOT in the subject for your best leads
    • emails the visitor their result, from your Gmail
    • can forward each lead to Zapier, Make, GoHighLevel, Follow Up Boss or any webhook
  • Or send leads straight to your tools. Formspree, Zapier, Make, GoHighLevel and other webhooks also work, and you can send to several at once.
  • Built for ads. It records UTM tags (utm_source, utm_campaign…) and the page and referrer, and can fire Meta Pixel Lead, Google generate_lead and Google Tag Manager events.
  • Calls-and-texts consent. An optional consent checkbox with your own wording. It is never pre-ticked, and the exact wording the visitor agreed to is saved with the lead.
  • Leads aren't lost. If a send fails (a dropped connection, say), it is retried the next time the visitor loads a page with the quiz. Visitors never wait more than 8 seconds.
  • Fits your site. It uses your site's fonts and colors, you choose one brand color, and it's shielded from common site-wide styles.
  • Accessible. Real labels, full keyboard support, screen-reader announcements and visible focus.
  • No database, plugin or account with us. One script of about 22 KB.

Open demo/index.html to try it.

Quick start (about 20 minutes)

  1. Write your quiz. The easiest way is the builder: open builder/quiz-builder.html from your download (or use it online at evergreencode.store/tools/quiz-builder/). Start from a template, change the questions, points and results, and watch the quiz update. It warns you if any score has no result. Then click Copy for Google Sheets and paste into a new Google Sheet. You can also open a file from templates/ in Google Sheets (File β†’ Import β†’ Upload) and edit the rows directly. Either way, replace "Your Brokerage Name" and the example links.
  2. Publish the quiz sheet: File β†’ Share β†’ Publish to web β†’ choose the tab β†’ Comma-separated values (.csv) β†’ Publish. Copy the link.
  3. Set up where leads go. Follow SETUP-GOOGLE-SHEET.md (free, recommended), or use one of the other options in that guide. You'll end up with a link to put in data-endpoint.
  4. Paste the snippet from embed/1-google-sheet-embed.html into your site, put in your two links, and publish. INSTALL.md has click-by-click steps for each site builder.
  5. Take the quiz yourself on the live page and check the lead arrives.
Embed fileUse it when
1-google-sheet-embed.htmlYour quiz is in a Google Sheet (easiest to edit later)
2-pasted-quiz-embed.htmlYou'd rather paste the quiz rows straight into the page
3-hosted-file-embed.htmlYou can upload files to your site

Your quiz spreadsheet

The first row holds the column names: Type, ID, Text, Points, Details, Link. Each row after that is one of five types:

TypeIDTextPointsDetailsLink
settingsetting nameits value
questionshort ID, e.g. timelinethe questionoptional help text under it
answerthe question's ID (or blank: the question above)the answerpoints, e.g. 6optional tag, e.g. timeline:0-3 months
resultshort ID, e.g. readyheadline the visitor seesscore range, e.g. 12+a paragraph of adviceoptional button link for this result
ratinglabel, e.g. Hotscore range, e.g. 12+

Score ranges look like 0-6, 7-11, 12+ or a single number. Make sure every possible score falls in one result and one rating: add up the lowest and highest answers to check. If a score matches no result, the visitor sees the first result with a blank Points cell, or else the last result in the list.

Settings

All optional. Put each on a setting row with the name in the ID column.

SettingWhat it doesDefault
title, introStart screen heading and text. Leave both out to begin with question 1.
start_buttonStart button textStart
gate_title, gate_textHeading and text above the contact formWhere should we send your results?
namerequired, optional or offrequired
phonerequired, optional or offoptional
name_label, email_label, phone_labelField labelsName, Email, Phone
consent_textShows a consent checkbox with this wording. Leave out for no checkbox.
submit_buttonContact form buttonSee my results
cta_text, cta_urlButton on the result screen, e.g. "Book a call". A result's own Link column overrides cta_url.
privacy_text, privacy_urlSmall print under the form, with an optional link to your privacy policyWe'll only use your details to follow up on your results.
progress_textProgress label. {n} and {total} are filled in.Question {n} of {total}
back_text, restart_text, sending_textOther button text, for translating the quizBack, Start over, Sending…

Snippet options

AttributeWhat it does
data-srcLink to your published quiz CSV
data-endpointWhere leads are sent. Several links separated by spaces send to each one. Must start with https://.
data-gate="off"No contact form: visitors see their result straight away. Use this for a quiz that's just for fun or engagement.
data-skip-start="true"Skip the start screen
data-redirectAfter the contact form, go to this page instead of showing the result. ?result=ID&rating=Hot is added, so you can build a thank-you page per result.
data-sourceA label saved with each lead, e.g. facebook-spring, to tell several quizzes or pages apart
data-track="meta google"Fire Meta Pixel Lead and/or Google generate_lead when a lead is captured. The pixel or Google tag must already be on your site. Google Tag Manager events (lead_quiz_lead, lead_quiz_complete) are always pushed if GTM is present.
data-accentYour brand color, e.g. #22476b

For developers, the quiz fires leadquiz:start, leadquiz:answer, leadquiz:lead and leadquiz:complete events on its element, with the lead in event.detail.

A note on calls, texts and fair housing

If you will call or text leads, especially with an auto-dialer or texting tool, the US TCPA and similar laws generally require clear consent. The templates include example consent wording. It is a starting point, not legal advice: have it checked for your business and state. Real estate quizzes should also avoid questions about protected characteristics (for example family status, religion or disability). The buyer template was written with this in mind.

Need help?

Email evergreen.code.info@gmail.com with a link to your page. See LICENSE.txt for your license terms.

Where leads go

The quiz sends each lead to the link (or links) in data-endpoint. Pick one option below. Most people start with Option A: it's free and does everything in your own Google account.

You'll get:

  • every lead added to a Leads tab in a Google Sheet
  • an email alert for each lead, with πŸ”₯ HOT in the subject for hot leads. Reply to the alert to email the lead directly.
  • the visitor emailed their result from your Gmail, with your "book a call" button
  • optional: each lead forwarded to your CRM or Zapier (see Option C)

Takes about 10 minutes. You need a Google account (a free Gmail account works).

1. Make the leads spreadsheet

  1. Go to sheets.google.com and create a blank spreadsheet. Name it something like "Quiz leads". This can be the same spreadsheet as your quiz questions, or a separate one. Separate is tidier: the quiz sheet is published to the web, and your leads must never be published.
  2. Click Extensions β†’ Apps Script. A code editor opens in a new tab.

2. Paste the script

  1. Delete everything in the editor (the function myFunction() {} text).
  2. Open apps-script/LeadQuiz.gs from your download in Notepad (or any text editor), copy all of it, and paste it into the editor.
  3. Near the top, in the SETTINGS section, change:
    • BUSINESS_NAME: your business name, shown as the sender of the result email
    • OWNER_EMAIL: where alerts go. Leave it as "" to use the Google account you're signed in with.
    • ALERT_RATINGS: leave "" to be alerted for every lead, or for example "Hot,Warm" to skip cold ones. Every lead is still saved to the sheet either way.
    • The RESULT_EMAIL_… lines: the wording of the email the visitor receives. Set SEND_RESULT_EMAIL to false to turn it off. Keep the quote marks and the comma at the end of each line.
  4. Click the Save icon (πŸ’Ύ).

3. Run the test and approve permissions

  1. In the toolbar, choose sendTestLead from the function dropdown, then click β–Ά Run.
  2. Google asks you to approve permissions. Click Review permissions, choose your account.
  3. You'll probably see "Google hasn't verified this app." That's normal for a script you added to your own sheet. Click Advanced β†’ Go to (your project name) (unsafe) β†’ Allow. The script asks to manage this spreadsheet, send email as you and connect to external services (used only if you set a forward webhook). It runs in your account. Nothing is sent to us.
  4. Check your spreadsheet: there's now a Leads tab with a test row. Check your inbox: you should have a HOT lead alert and a result email.

4. Publish it as a web app

  1. Click Deploy β†’ New deployment.
  2. Click the gear βš™ next to "Select type" and choose Web app.
  3. Set:
    • Execute as: Me
    • Who has access: Anyone. This lets the quiz on your website send leads to it. It doesn't give anyone access to your spreadsheet.
  4. Click Deploy, then copy the Web app URL. It starts with https://script.google.com/macros/s/ and ends in /exec.
  5. Paste it into your snippet as data-endpoint="https://script.google.com/macros/s/…/exec".

To check it's live, open the URL in your browser. You should see "Evergreen Lead Quiz is connected."

5. Test from your website

Publish your page, take the quiz with your own email, and check that a new row appears and the emails arrive. Do this before you send any traffic or ads to the page.

Changing settings later

After you edit the script, click Deploy β†’ Manage deployments β†’ ✏️ Edit β†’ Version: New version β†’ Deploy. The URL stays the same. If you skip this, the old version keeps running.

Good to know

  • Email limits: Google limits how many emails a script can send per day. At the time of writing that's about 100 recipients a day for free Gmail accounts and 1,500 for Google Workspace, and each lead uses up to two (your alert and their result). Leads are always saved to the sheet even if the limit is reached. Google can change these limits.
  • Result emails come from your Gmail. The first ones may land in Promotions or spam. Ask a friend to take the quiz and mark it "Not spam".
  • Sort and filter: the Leads tab has a Rating column. Use Data β†’ Create a filter to show only Hot leads.
  • You own the data. It lives in your Google account. Delete rows whenever you like.

Option B: Formspree (email only)

If you'd rather not use Google: create a free form at formspree.io, copy its link (https://formspree.io/f/…) and use it as data-endpoint. Each lead arrives as an email with the rating in the subject. Formspree's free plan has a monthly submission limit. The visitor doesn't receive a result email with this option.

Option C: Zapier, Make, GoHighLevel or your CRM

Any tool that gives you a webhook URL ("Catch Hook" in Zapier, "Custom webhook" in Make, "Inbound Webhook" in a GoHighLevel workflow) can receive leads:

  1. Create the webhook in your tool and copy its https:// URL.
  2. Either put it in data-endpoint (several links can go in, separated by spaces), or put it in the script's FORWARD_WEBHOOK_URL setting so the Google Sheet forwards each lead. The second way keeps the sheet as your backup copy.
  3. Take the quiz once so the tool sees a sample lead, then map the fields.

The fields sent are:

FieldExample
name, email, phoneJordan Smith, jordan@example.com, 405-555-0100
consent and consent_texttrue, and the exact wording they agreed to
score, rating14, Hot
result, result_id, result_body, result_linkYou're ready to sell, ready, …
tags["timeline:0-3 months", "agent:none"]
answersa list of { question, answer, points }
sourceyour data-source label
trackingutm_source, utm_medium, utm_campaign, utm_term, utm_content, gclid, fbclid, page, referrer
quiz, submitted_atthe quiz title, and the time in UTC

Tags are handy here. For example, a GoHighLevel workflow can add timeline:0-3 months as a contact tag and start your fastest follow-up for those leads.

Troubleshooting

ProblemFix
No row appearsCheck data-endpoint is the /exec URL (not /dev or the editor address), and that "Who has access" is Anyone. Open the URL in a browser to check.
Rows appear but no emailsRun sendTestLead again from the editor and approve any new permissions. Check spam. Check the daily email limit.
You changed the script but nothing changedDeploy a new version (see "Changing settings later").
"Script function not found: doPost"The whole script wasn't pasted. Paste it again, save, and deploy a new version.
The quiz warns "No data-endpoint set" in the browser consoleAdd data-endpoint to the snippet. Without it, contact details aren't sent anywhere.

Installation

Every install has three parts:

  1. Your quiz: a published Google Sheet, rows pasted into the page, or an uploaded CSV file.
  2. Where leads go: the link you put in data-endpoint. See SETUP-GOOGLE-SHEET.md.
  3. The snippet: one of the files in embed/, pasted where you want the quiz to appear.
  1. Go to sheets.google.com, then File β†’ Import β†’ Upload and choose a file from templates/.
  2. Edit the rows. The column guide is in README.md.
  3. Click File β†’ Share β†’ Publish to web.
  4. Under Link, choose the tab with your quiz, change "Web page" to Comma-separated values (.csv), and click Publish.
  5. Copy the link it shows. It contains /pub? and ends in output=csv.

Use this link, not the address in your browser bar. A link ending in /edit will not work, and the quiz will show a message in the browser console if you paste one by mistake.

After publishing, changes to the quiz sheet appear on your site within about 5 minutes.

Never publish the spreadsheet your leads go into. Keep quiz questions and leads in separate spreadsheets, or at least publish only the quiz tab.

Step 2: Set up where leads go

Follow SETUP-GOOGLE-SHEET.md. At the end you'll have a link to put in data-endpoint.

Step 3: Add it to your site

Lead Quiz works on any website where you can paste HTML. The steps are the same everywhere:

  1. Add an HTML / code / embed block where the quiz should appear.
  2. Paste the contents of the embed file you chose.
  3. Put in your quiz link and your data-endpoint link, then publish.

The embed files use the compact script (dist/lead-quiz.min.js, about 22 KB). That keeps them under the size limits some builders put on code blocks.

Most builders only run custom code on the published page, not inside the editor. If you see code or a blank box while editing, check the live page.

Any website (HTML)

Put the <div data-lead-quiz …> line where the quiz should appear. Then load the script once anywhere on the page:

  • Inline: paste the <script>…</script> part of embed file 1.
  • From a file: upload dist/lead-quiz.min.js and use <script src="lead-quiz.min.js" defer></script>.

The CSV must be on the same website or a Google Sheets "Publish to web" link. A CSV on another website only loads if that site allows it (CORS).

Carrd

  1. Add an Embed element and set Type to Code.
  2. Paste the embed file, then set your two links.
  3. Under Style, choose Inline.

Embeds need a Carrd plan that includes them.

Ghost

  1. In the post or page editor, type /html to add an HTML card.
  2. Paste the embed file, then set your two links.
  3. Publish.

Shopify

  1. Go to Online Store β†’ Themes β†’ Customize.
  2. Open the page template where the quiz should go, for example a "Get started" page.
  3. Click Add section and choose Custom Liquid.
  4. Paste the embed file, set your two links, and click Save.

This works with Shopify's Online Store 2.0 themes, such as Dawn and the other free themes Shopify has offered since 2021. If Custom Liquid isn't in the list, your theme is older and doesn't support this method. Email us and we'll help.

Shopify limits a Custom Liquid section to 50 KB. The Google Sheet snippet fits easily. If you paste a long list of rows straight into the snippet and Shopify won't save it, use the Google Sheet option instead.

Squarespace (7.0 and 7.1)

Squarespace runs scripts in Code Blocks only on plans that allow custom code. If your plan doesn't, the block will show the code instead of the quiz.

  1. Open the page, click Edit, and add a Code block.
  2. Paste the embed file, replacing what's there, then set your two links.
  3. Click Apply, then Save.

Webflow

  1. Drag a Code Embed element onto the page.
  2. Paste the embed file, then set your two links.
  3. Click Save & Close, then Publish. The quiz only runs on the published site, not in the Designer.

Code Embed needs a Webflow site plan that allows custom code.

Wix

  1. Add Embed Code β†’ Embed HTML.
  2. Choose Code, paste the embed file, then set your two links.
  3. Resize the box so it's tall enough. Wix shows embeds in a fixed-height frame.

WordPress

Block editor:

  1. Add a Custom HTML block.
  2. Paste the embed file, set your link and click Update.

Uploading your own files:

  1. Upload dist/lead-quiz.min.js and your CSV through Media β†’ Add New. If your site blocks .js uploads, use the Google Sheet option instead.
  2. Copy each file's URL.
  3. Put them into embed/3-hosted-file-embed.html, and paste that into a Custom HTML block.

Some security plugins strip scripts from posts. If the block shows nothing on the live page, use a "header and footer scripts" plugin to load the script.

Sending ad traffic to the quiz

  • Put the quiz on its own page with little else on it, and send ads straight there.
  • Add UTM tags to your ad links, for example https://yoursite.com/sell?utm_source=facebook&utm_campaign=spring. They're saved with each lead.
  • Add data-track="meta" (Meta Pixel), data-track="google" (Google tag) or both to report leads back to your ad platform. Your pixel or tag must already be installed on the site.

Two quizzes on one page or site

Each can use its own data-src. Give each a different data-source, for example data-source="sellers" and data-source="buyers", so you can tell the leads apart.

Troubleshooting

What you seeFix
"This quiz isn't available right now"Open your data-src link in your browser: it should show plain text with commas. For Google Sheets, re-check Step 1.4: the format must be .csv. The browser console (F12 β†’ Console) shows a "[Lead Quiz]" message with the exact problem.
The page shows the code as textYour platform or plan isn't running scripts in that block. Check the live page, and check your plan allows custom code.
Nothing at all appearsMake sure you pasted the whole snippet, including the <script> part. Then check the browser console for a "[Lead Quiz]" message.
A question is missingEach question needs at least two answers. The console lists any rows it skipped and why.
Leads don't arriveSee the troubleshooting table in SETUP-GOOGLE-SHEET.md.
The wrong result showsCheck the score ranges in your result and rating rows cover every possible total, with no gaps or overlaps.
Columns are mixed upA cell containing a comma must be in quotes when you write a CSV by hand. Google Sheets and Excel do this for you.

Changelog

1.0.0 (2026-10-15)

First release.

  • Quiz from a spreadsheet: questions, answers, points, results, ratings and all wording in a Google Sheet, CSV file, or rows pasted into the page.
  • Scoring: points per answer, score-range results, Hot / Warm / Cold (or your own) ratings, and answer tags.
  • Contact form:
    • name, email and phone, each required, optional or off
    • optional consent checkbox, never pre-ticked, with the wording saved with the lead
    • can be turned off for quizzes that don't collect leads
  • Lead delivery:
    • Google Apps Script for Google Sheets: saves leads, emails the owner an alert, emails the lead their result, optional webhook forward
    • Formspree, Zapier, Make, GoHighLevel and other webhooks; several at once
    • failed sends are retried on the visitor's next visit
  • Ads and tracking: UTM, gclid and fbclid capture; page and referrer; Meta Pixel, Google tag and Google Tag Manager events; optional redirect to a thank-you page per result.
  • Templates: home sellers, home buyers, wellness and service businesses.
  • Works on any website: install guides for Carrd, Ghost, Shopify, Squarespace, Webflow, Wix, WordPress and plain HTML.
  • Accessibility and safety:
    • labels, keyboard support and screen-reader announcements
    • all text is escaped and unsafe links are removed
    • spreadsheet formula injection is blocked in the lead sheet