window. Listen to them to track behaviour in your analytics, react to answers, or run your own code at the right moment.
event.detail. Two things are always there:
quizId: which quiz fired the eventllQuizApi: the Quiz API, so you can read or change the quiz right in the listener
ll-quiz-init fires as soon as the quiz is ready, which can be before your script runs. Do not worry about it: a listener registered late still receives ll-quiz-init. All other events fire on visitor actions, after your script is in place.Events at a glance
ll-quiz-init
Fires once the quiz is on the page and ready. This is where you grabllQuizApi, prefill values, or set things up.
string
LlQuizApi
The Quiz API for this quiz
ll-quiz-step-view
Fires every time a step is shown, including the first one on load and when the visitor goes back.string
string
Field[]
Answers given so far, see fields and fieldsSimple
object
The same answers as label → value
ll-quiz-step-leave
Fires when the visitor navigates away from a step, before the nextll-quiz-step-view. Use it to measure how long a step took or to save a draft.
string
ll-quiz-value-change
Fires when an answer is committed. Typed fields (text, email, phone, number, textarea, date, birth date, zip code, address, OTP) commit when the visitor leaves the field or the step, so you get one event per answer, not one per keystroke. Every other input, and every value set through the API, commits immediately.string
string
The block’s name from the builder
string
For example
text-field or multiple-choicestring
string
string
The new answer, in the same format as
Field.valuestring
The answer reported last time, or the value the quiz loaded with
'user' | 'api' | 'system'
user: the visitor. api: your script through the Quiz API. system: the quiz itself, for example clearing answers after submitfields on ll-quiz-step-view.
ll-quiz-input-click
Fires when the visitor clicks an option of a multiple choice or image choice block. Fires beforell-quiz-value-change for the same click.
string
string
string
string
string
string
The option’s value, as stored in the answer
string
The text the visitor saw
ll-quiz-button-click
Fires when a Continue, Previous, Submit or Button block is clicked, before any validation. It fires even when the click ends up blocked, so it counts attempts, not successes.string
string
string
string
ll-quiz-validation-error
Fires when an attempt to leave a step was blocked because something on it is invalid. You get one event per attempt, after all checks finished (including the server checks of email, phone and OTP fields), listing exactly the errors the visitor sees. Hidden blocks are never included.string
string
'user' | 'api' | 'system'
user: a button or a navigating option. api: your script (validateStep(), goNext(), goToStep(), submit()). system: the quiz tried to advance on its own (loader, countdown, payment)string
The button or option that started it; empty for
apistring
Empty for
apiarray
One entry per failing block, in step order:
blockId, blockName, blockType, and messages (the texts shown; the first one is displayed)ll-quiz-google-address-select
Fires when the visitor picks a suggestion in a Google Address block.string
string
string
string
object
street, city, state, stateShort, postalCode, country, countryShortll-quiz-submit
Fires when the quiz was submitted, after the lead was saved. This is the place to send answers elsewhere or fire a conversion.string
The step the visitor submitted from
string
Field[]
All answers
object
All answers as label → value
any
What the LanderLab server answered, or
null when no lead was saved (for example lead saving is off in the quiz settings)ll-quiz-exit
Fires when the tab or window is closed or navigated away from, based on the browser’spagehide event.
fields and fieldsSimple
fields is a list with one entry per answered block:
fieldsSimple is the same information as one object keyed by label, handy for forwarding:
fieldsSimple joins their values with a comma. The Quiz API returns the same shapes from getAnswers() and getAnswersSimple().