Content | Navigation |

Embed Qualtrics survey

  1. Log in to Qualtrics
  2. Edit the survey you plan to embed
  3. Click Look & Feel
  4. Click Change Theme and select a theme with a predominantly white background and black text, such as Qualtrics 2017, Minimal 2014, or Minimal 3D Gold (so the embedded survey will appear as a part of the page)
  5. Click the Advanced tab
  6. Click the edit link under Header
  7. Click the Source WYSIWYG button
  8. Paste in the JavaScript code snippet without modification
  9. Click Save twice to get back to the main survey edit page
  10. Click the Distributions tab
  11. Click the +Distribute Survey button
  12. Click the Get a single reusable link button
  13. Copy the provided link (looks like
     https://ndstate.co1.qualtrics.com/jfe/form/FORM_ID )
  14. Log in to CMS
  15. Create a new Qualtrics content element (Form > Qualtrics)
  16. Paste the link address from step #13 into the Form URL field
  17. Save and close; publish as usual

Code snippet

Copy the following code in its entirety, without modification where prompted in step 8 (above). If you don't include it in your Qualtrics survey, the survey frame will not be able to automatically scale to the size of the survey and visitors may need to scroll to see all of the survey fields.

<script type="text/javascript">
Qualtrics.SurveyEngine.addOnload(function() {
    // if not loaded in a frame, no work needed
    try {
        if ( top.document.domain != self.document.domain ) {
            // nothing is needed (action happens on exception from trying to access cross-domain parent)
        }
    }
    catch (e) {
        var domain = '';
        var referrerDomain = document.referrer.split('/')[2];

        // allow use on the production and preview domains (only)
        if (referrerDomain == 'workspaces.ndsu.edu') {
            domain = 'https://workspaces.ndsu.edu';
        }
        else if (referrerDomain == 'www.ndsu.edu') {
            domain = 'https://www.ndsu.edu';
        }


        if (domain != '') {
            // on allowed domains, send a (frame height) message on a 500ms interval
            var intervalVar = setInterval(function() {
                window.top.postMessage(document.body.scrollHeight, domain);
            }, 500);
        }
    }
});

Qualtrics.SurveyEngine.addOnReady(function() {
});

Qualtrics.SurveyEngine.addOnUnload(function() {
    if (typeof intervalVar !== 'undefined') {
        clearInterval(intervalVar);
    }
});
</script>

Example form


Student Focused. Land Grant. Research University.

Follow NDSU
  • Facebook
  • Twitter
  • RSS
  • Google Maps

North Dakota State University
IT Help Desk: +1 (701) 231-8685
Physical address: Quentin Burdick Building 206, 1320 Albrecht Blvd., Fargo, ND 58105
Mailing address: NDSU Dept. 4530 / PO Box 6050 / Fargo, ND 58108-6050
Page manager: Content Management System

Last Updated: Tuesday, June 26, 2018 12:05:31 PM
Privacy Statement