How to Recommend Products Based on the Number of Choices¶
Recommend a different group of products depending on how many choices the customer selects.
The quiz cannot do this on its own. This method adds a hidden choice for each possible outcome, then uses custom JavaScript to pick the right one.
Before you start
This is not plug-and-play. If you are not familiar with JavaScript and CSS, ask a developer for help.
Set up the recommendations¶
- Create one collection for each outcome. Each collection holds the products for one outcome. Name them
1/10 choices selected,2/10 choices selected, and so on. - Add one hidden choice per collection. They all go in the final question of the quiz.
- Link each choice to its collection. See Link Collections.
- Hide those choices with custom CSS. The choices are there for the script, not for the customer. See how to customize the quiz design.
-
Add custom JavaScript to the final question. The script counts the choices the customer selected across the quiz. It then clicks the hidden choice that matches that number. See how to add JavaScript to the quiz.

-
Click
Saveto update the preview and the live quiz.
- Create one collection for each outcome. Each collection holds the products for one outcome. Name them
1/10 choices selected,2/10 choices selected, and so on. - Add one hidden choice per collection. They all go in the final question of the quiz.
- Link each choice to its collection. See Link Collections.
- Hide those choices with custom CSS. The choices are there for the script, not for the customer. See how to customize the quiz design.
-
Add custom JavaScript to the final question. The script counts the choices the customer selected across the quiz. It then clicks the hidden choice that matches that number. See how to add JavaScript to the quiz.

-
Click
Publishto update the preview and the live quiz.
- Create one category for each outcome. Each category holds the products for one outcome. Name them
1/10 choices selected,2/10 choices selected, and so on. - Add one hidden choice per category. They all go in the final question of the quiz.
- Link each choice to its category. See Link Categories.
- Hide those choices with custom CSS. The choices are there for the script, not for the customer. See how to customize the quiz design.
-
Add custom JavaScript to the final question. The script counts the choices the customer selected across the quiz. It then clicks the hidden choice that matches that number. See how to add JavaScript to the quiz.

-
Click
Publishto update the preview and the live quiz.
- Create one category for each outcome. Each category holds the products for one outcome. Name them
1/10 choices selected,2/10 choices selected, and so on. - Add one hidden choice per category. They all go in the final question of the quiz.
- Link each choice to its category. See Link Categories.
- Hide those choices with custom CSS. The choices are there for the script, not for the customer. See how to customize the quiz design.
-
Add custom JavaScript to the final question. The script counts the choices the customer selected across the quiz. It then clicks the hidden choice that matches that number. See how to add JavaScript to the quiz.

-
Click
Publishto update the preview and the live quiz.
- Create one category for each outcome. Each category holds the products for one outcome. Name them
1/10 choices selected,2/10 choices selected, and so on. - Add one hidden choice per category. They all go in the final question of the quiz.
- Link each choice to its category. See Link Categories.
- Hide those choices with custom CSS. The choices are there for the script, not for the customer. See how to customize the quiz design.
-
Add custom JavaScript to the final question. The script counts the choices the customer selected across the quiz. It then clicks the hidden choice that matches that number. See how to add JavaScript to the quiz.

-
Click
Publishto update the preview and the live quiz.
- Create one collection for each outcome. Each collection holds the products for one outcome. Name them
1/10 choices selected,2/10 choices selected, and so on. - Add one hidden choice per collection. They all go in the final question of the quiz.
- Link each choice to its collection. See Link Collections.
- Hide those choices with custom CSS. The choices are there for the script, not for the customer. See how to customize the quiz design.
-
Add custom JavaScript to the final question. The script counts the choices the customer selected across the quiz. It then clicks the hidden choice that matches that number. See how to add JavaScript to the quiz.

-
Click
Publishto update the preview and the live quiz.
Find the choice IDs with JavaScript¶
Add this to the Custom JavaScript section of a question, then take the quiz with the browser console open (F12):
It lists every block ID and its value. Each answer carries a .choicesRefs array holding the selected choice IDs. See Find block and question IDs.
To see the choice IDs selected for each slide, open the JavaScript console and search for them:

Type prq.quizSlides() in the console to list every slide with its ID. See Find block and question IDs.
To see the choice IDs selected for each slide, open the JavaScript console and search for them:

Type prq.quizSlides() in the console to list every slide with its ID. See Find block and question IDs.
To see the choice IDs selected for each slide, open the JavaScript console and search for them:

Type prq.quizSlides() in the console to list every slide with its ID. See Find block and question IDs.
To see the choice IDs selected for each slide, open the JavaScript console and search for them:

Type prq.quizSlides() in the console to list every slide with its ID. See Find block and question IDs.
To see the choice IDs selected for each slide, open the JavaScript console and search for them:

Type prq.quizSlides() in the console to list every slide with its ID. See Find block and question IDs.
This article explains how to recommend products based on the number of choices the customer selects.