How Do I Setup a Dynamic Code With Qualtrics?

When you use a dynamic completion code, CloudResearch can ensure each worker receives a unique code. In addition, you can set your study up so that each worker who submits the correct code is automatically approved.

Setting up a Dynamic Code in Qualtrics

To setup a dynamic code in Qualtrics, follow the steps below.

  1. Navigate to the bottom of your survey builder and click on the "End of Survey" block. Once you click the block, you will see an end of survey options panel appear to the left of the survey builder.
    knowledge base_dyanmic code [qualtrics set up]_12.01.2021
    knowledge base_dyanmic code [qualtrics set up custom panel]_12.01.2021
  2. Within the "End of Survey" block, change the Default end of survey message option to "Custom." Then, where it says "Enter Code" click, hover over "My Library" and select "New Message" within the list of options.

    knowledge base_dyanmic code [new secret key]_12.01.2021

  3. When the box to Create a New Message appears, type "Secret Key" into the description box.
  4. Next, click on the "source code" button. When you do, the text box below will change to a source code box where you can paste the code needed for the dynamic secret key to operate.

  5. Once you have the source code box open, paste the code below into the box exactly as it appears.

    <iframe width='100%' height='200' id="cr_secretcode"></iframe>
    function createIFrame() {
    var ref = encodeURIComponent(;
    var ifrm = document.getElementById("cr_secretcode");
    ifrm.setAttribute("src", "" + ref);

    The result should look like this:
  6. Finally, click "Save." The Secret Key you just created should be selected as the end of survey message.


Testing your Dynamic Code

If you want to test the dynamic code to ensure it is working properly, you should do so using the "CloudResearch Survey Preview" associated with your study.

First, navigate to your study and click on it to reveal the extended view. In the lower left corner, find the link titled "CloudResearch Survey Preview" and click on it. You will see the box workers are presented with on Mechanical Turk.  

knowledge base_setup dynamic code with qualtrics_[dashboard CR preview highlight]_12.22.2020 

From here, you can walk through your survey by clicking on the study link. If the dynamic code is operating correctly, you should see an image like the one below at the end.


dynamic code


If your code is not working properly or if you try previewing the dynamic code using something other than the CloudResearch Survey Preview link, you will receive an error message like the one below.