GetQuiz has support for macros, or in other words, substitution variables. With their help, you can display the user's answer to the previous question on the quiz page. This allows you to make the quiz as personalized as possible.
Macros can be used:
- in the title and description of the question
- in the consultant's tips
- in the contact form
- in the results
- on the page thanks
By default, the question macro looks like this - {cKWa7GDBc2lckMxuVHAI}, i.e. the question ID in curly brackets. But you can change it. To do this, go to the settings of the desired question in the "Macro" tab:
The macro name may contain:
- latin letters
- numbers
- symbols "-" and "_"
- upper and lower case
To select the required macro, you can use a special icon that is displayed inside the field:
Clicking on this icon will open a pop-up window with a list of all available macros that can be used in this location.
You can copy the value from the "Macro" column or click the "Add" button.
Thus, when the user answers questions and a macro is found in the quiz text, it will be automatically replaced with the value that the user entered in the quiz.
Passing Macros via URL
In addition, you can pass initial macro values via URL. To do this, you need to create a link to the quiz in this format:
https://quiz.getquiz.io/path?macro=value
where macro is the name of the macro without curly braces, and value is the value that will be written.
Based on the image above, we have a macro {Q1}. To pass its value to the quiz via URL, we need to create a link like this:
https://quiz.getquiz.io/path?Q1=Answer
If the question has answer options, but the text value of the desired answer option must be passed as the value.
If you don’t understand something or can’t set it up, you can always write your question to us in the online chat on the website or send it by email.