Hi everyone,
I am building a conjoint experiment involving 5 different product blocks. Each product block uses Loop & Merge to display 5 randomized scenarios to the participant (25 total decision scenarios per respondent).
The Setup:
I am using JavaScript to generate randomized attributes for each scenario (e.g., Price, Credit Balance, Payment Terms, Credit Limit). The randomization logic is complex (e.g., Credit Balance depends on the Credit Limit assigned earlier).
The Problem:
I initially tried calculating these values inside the loop and saving them using Qualtrics.SurveyEngine.setEmbeddedData. However, this caused data overwriting issues.
I then tried "Pre-Calculating" all 25 values at the start of the survey and saving them to distinct Embedded Data fields (e.g., shoe_price_1, shoe_price_2... bag_price_5).
Current Roadblocks:
-
Reliability:
setEmbeddedDataseems to have "handshake" issues where the data isn't always committed to the server in time for the next block to display it (showing blank or "undefined" values). -
Setup Load: This requires manually initializing over 125 separate variables in the Survey Flow to ensure they are captured, which is error-prone and will honestly be super taxing.
My Proposed Solution (The "Shadow Storage" Method):
To bypass the Embedded Data sync issues, I am considering calculating all 25 scenarios in a single JavaScript block at the very beginning. I would then concatenate the entire dataset into a single string (e.g., Loop1_Data::Loop2_Data::...) and force-write it into a Hidden Text Entry Question using jQuery.
My Questions:
-
Is writing to a hidden Text Entry question considered a more reliable method than
setEmbeddedDatafor ensuring complex randomized data is captured in the final export? -
For the syntax, is
jQuery("#QR~" + this.questionId).val(finalString)the standard way to target a question's input box from within its own JavaScript, or is there a safer API method? How exactly can I ensure the displayed value gets stored in the embedded data.
I want to ensure that my randomization data is 100% safe for analysis later. Thanks for any advice!
