Smart Loops are a tool that uses automated group logic to quickly replicate groups of questions. Whether you're working on a monadic or sequential monadic survey design, or you have elements that need to be repeated, Smart Loops will greatly reduce your programming time and effort. Smart Loops have their own interface in the Survey Editor that can be activated in a few ways.
Adding Smart Loops: From the Question Type Menu
- Click on a question type icon within your survey, or the New Question button at the bottom, and select Add a/Convert into a Smart Loop in the top right corner of the menu.
Adding Smart Loops: From the Logic Guide
- Click the Logic Guide icon in the right menu to open the aytm Logic Guide.
- Grab the grey handle to the right of the banner labeled Smart Loop Empty Example and drag it into the Survey Editor to activate a new Smart Loop builder.
- Alternatively, drag the Smart Loop Image Example into the survey to see and interact with a pre-built Smart Loop table.
Read more about the aytm Logic Guide here.
Building a Smart Loop
The columns in the Smart Loop represent variables you can add to your survey. When you add a new Smart Loop, the default has [variable_1] and [variable_2] populated.
- Click the + button to the right of the table to add up to 50 variables — text, video, or image — per Smart Loop.
- Click into the [variable_#] default text to give the variable a unique name. This name acts as a reference for that variable in the rest of your Smart Loop. Hover in the white space of a variable column and click the x to delete the column.
- Populate the table with your content. Paste multi-line text into a column to create as many runs as there are copied lines, or click + Add below the last run to add up to 200 runs.
Assigning Runs
Think of runs as monadic legs of your survey. If you have 4 concepts to test, you would have 4 runs in a Smart Loop. Runs are expressed by each row in the table. Each run (row) should contain a single concept — for example, Concept A image, Concept A brand name, and Concept A logo should all be in the same run (row).
- Click the Show dropdown to select how many runs each respondent evaluates.
💡 Tip: Select All runs/respondent to ensure that, if you add runs later, respondents will still see all concepts.
Use this equation to calculate how many respondents will go through each run:
[total N] * [# of runs/respondents] / [# runs] Example: [N400] * [max 2] / [4 concepts] = ~200 respondents/run
⚠️ Note: This assumes there is no logic (e.g. show/hide if) within the nodes. Conditional logic that restricts who can see questions or sets of questions could impact distribution.
Advanced Settings
- Click the gear icon at the top right to open the Advanced Settings interface.
- Click the dropdown next to Assign runs to toggle between Evenly and Randomly. The default, Evenly, uses randomization with controls to provide an approximately equal distribution of respondents across runs and an approximately equal distribution of the order in which multiple runs are seen. Randomly uses pure randomization without any controls for distribution.
- Click into the Balance by text box to customize group logic and distribute respondents within runs proportionately to a specific trait or to answers to a previous question.
⚠️ Note: When All Runs is selected, an additional option — Static Order — appears under the Assign runs dropdown. This presents all questions in the order they're programmed, to all respondents.
Syntax for Balancing
When balancing by traits in a Smart Loop, trait characteristics must be in quotation marks (single or double). Generally, balance by no more than 2 overlapping groups in a Smart Loop.
⚠️ Note: To use balancing syntax, Smart Loop runs must be assigned Evenly. If runs are assigned Randomly, balancing syntax will not be applicable.
Programming syntax within Smart Loops:
-
Balancing by gender (US, UK, CA):
gender = "f", gender = "m", gender = "n"
-
Balancing by age:
age <=34 and age >=54, age >=35 and age <=54
-
Balancing by US race trait:
hispanic = "yes", hispanic = "no", race = "whiteamerican", race = "africanamerican", race = "asianamerican", race = "nativeamerican", race = "other"
-
Balancing by answer selections (Q5A8, Q5A9, Q4A2) among groups [Group Q6-9 and Q10-13 and Q14-17]:
Q5A8, Q5A9, Q4A2
When adding balancing parameters to Group logic (including within Smart Loops), you are specifying that the distribution of respondents matching that criteria are balanced evenly across nodes (e.g. ~33% of females will be assigned to each of Q2-4, Q5-7, and Q8-10). Any between-respondent segment balancing needs to be specified at the survey level through the Target Market page for traits, or custom quotas for question responses.
The exception is the syntax for balancing age, since it holds numeric values. See another example of age balance syntax here.
⚠️ Note: All of these settings are based on the total number of respondents requested, runs per respondent, and the number of runs. Conditional logic (e.g. show/hide if) within the question sets or nodes will impact distribution.
Programming Your Question Set
- Click Add a question to the Smart Loop to open the New Question menu and add a question. Questions included in the Smart Loop are connected by the blue bar on the left.
- Use the variables in the Smart Loop table to reference specific data points to replace in each run.
⚠️ Note: Unlike other aytm Logic, SmartLoop variable references are case sensitive. If you do not include references to your variables in the Smart Loop questions, you will not be able to launch your survey.
Converting to Regular Questions
To view the logic used to program the Smart Loop, or to customize the question sets, click the settings wheel to open Advanced Settings, then click Convert into regular questions. Questions will appear in the master question set with all runs listed sequentially.
If you're simply checking the logic, click the Undo button to convert back into a Smart Loop.
Additional Smart Loop Logic
- Reference variables in questions using the [variable_#] defaults or the case-sensitive custom references.
- Type :x inside the bracket after an image variable name to expand an image, :s to allow respondents to scroll on an image, and :xs to expand and scroll. For example, if the image variable is [ad], the logic [ad:x] will show the image expanded to respondents. Use the preview link above the question to confirm how it will appear.
- Use [run] in combination with conditional logic to customize question presentation. For example, [show if [run]=1] will only show a question for the first run/concept.
Nested Group Logic within Smart Loops
To further manipulate the order of your concepts within the Smart Loop, you can use Nested Group Logic to randomize sub-groups and/or indicate a leading question followed by other randomized groups. Learn more about Nested Group Logic.
Unused Variable Errors
If you have a variable in your Smart Loop table that isn't referenced in any question text — for example, an internal label you want in the data but don't want respondents to see — you won't be able to launch your survey. To keep this variable in your table but hidden from respondents, place this logic on any question within the Smart Loop to bring your concept names into the stats page and data as a hidden label — visible to you but not the respondent:
[ProductID_[run] = "[variable_1]"]
- ProductID_ — the name of your hidden label (this can be renamed, as long as it does not use existing logic commands like group or skip).
- [run] — the number pulled from the [run] column in the Smart Loop console (to the left of your custom variables). This is important when respondents see multiple runs, so each concept has its own label. Otherwise the respondent-level label will be overridden to the last concept they were exposed to.
- "[variable_1]" — pipes in the label/information you programmed for this variable. Be sure to use quotation marks around this piece of logic to ensure it is piped in correctly.
Other examples:
[conceptdescription_[run] = "[variable_1]"] [internalname_[run] = "[variable_1]"]