Update to Qualtrics JavaScript Conjoint Randomization Code

Are you using the standard JavaScript code written by Thomas Leeper (Git) in your conjoint project? Wondering why your traits1a variable is no longer storing the piped traits? The answer is straightforward. You need to change your embedded variable names and the command you’re using in JavaScript to save the traits. (Here’s the random forum post that helped me understand this; apparently, it has to do with the migration to Simple, but maybe it’s deeper. User Tom_1842, you da real one.)

First, your traits embedded variables need to have this prefix (no quotes): “__js_”.

Second, you need to change your code block:

Qualtrics.SurveyEngine.setEmbeddedData('traits1a', traits_a.join("|"));
Qualtrics.SurveyEngine.setEmbeddedData('traits1b', traits_b.join("|"));

To instead be
Qualtrics.SurveyEngine.setJSEmbeddedData('traits1a', traits_a.join("|"));
Qualtrics.SurveyEngine.setJSEmbeddedData('traits1b', traits_b.join("|"));