UnCaught Reference Error:Qualtrics not Found | XM Community
Skip to main content

Hi,

I am in an requirement to add the javascript code into an existing website code which basically functions to capture the embedded data such as CAID and Email ID which I have configured these fields in the survey flow of the particular survey and also in the website intercept embedded data by choosing the type as the Value from Javascript in order to store the values for the particular embedded data field from the javascript code . 

The javascript code which I have incorported in the existing website code 
 

  <script>

Qualtrics.SurveyEngine.addOnLoad(function()

{

Qualtrics.SurveyEngine.addOnPageSubmit(function(type)

{

if(type == "next")

{

            var EmailID = "xxx@xxx.com";

        var CAID = 935326;

            Qualtrics.SurveyEngine.setEmbeddedData('EmailID', EmailID);

Qualtrics.SurveyEngine.setEmbeddedData('CAID', CAID);

    }

});

});

    </script>

and also I have placed the website intercept deployment code at the header section 
I am getting the “Uncaught ReferenceError ReferenceError: Qualtrics is not defined” error can anyone suggest an solution to tackle this error 

 

 

Thanks in Advance 

Regards,

Harshitha R

 

 

I have very little Javascript experience.   However, I have decades of experience doing Google searches.

The JavaScript exception "variable is not defined" occurs when there is a non-existent variable referenced.  It means that you’re trying to use the Qualtrics variable before it was declared using var, which I assume is done in the Qualtrics js library files.

Basically, the error means that the code you supplied above was run before the Qualtrics files were,  Put your code lower, below the Qualtrics includes.

There can be other causes:

  • Conflict with Other Libraries
  • Path to your library included is not correct
  • Llibrary file is corrupted
  • Working offline (when you use CDN)

But move your code down and see if that solves it

 


Leave a Reply