Unable to pass custom data to Qualtrics through JavaScript on submission of survey | XM Community
Skip to main content

Hi everyone! I'm also in a similar position. I'm using Qualtrics to record feedback data. However, I also want to record some metadata (

groupId
) around this. I'm passing the metadata through JavaScript according to the documentations mentioned. Below is my HTML code snippet:




I have included this in the base HTML file. Most of the script was mentioned in the documentation. I've only added the
addOnload
method. However, on my server, it says
Uncaught ReferenceError: Qualtrics is not defined
. Isn't the script supposed to define Qualtrics on its own? Could anyone point out what I'm missing here? Thanks!

Are you using Site Intercept? If so, see this.


Hi Tom! Yes, I'm using a site intercept. I have added variables for capturing embedded data in the Qualtrics intercept. Also, I'm passing these values (

groupId, permissions, email, firstName, etc.
) through JavaScript as mentioned in the code block below. When I run my app, there is a console error which says
Uncaught ReferenceError: Qualtrics is not defined
. I thought that the script included will take care of defining Qualtrics in the scope?






Screenshot 2022-08-24 at 2.32.07 PM.pngI've added groupId above in the Qualtrics dashboard but I'm not getting the value here. What could be the possible fix here?
PS: I'm able to see the intercept on my app and I'm also able to submit responses. It's just that I'm unable to send metadata along with the responses.


https://community.qualtrics.com/XMcommunity/discussion/comment/48760#Comment_48760I'm no expert on Site Intercept, but I think you have to set groupId in the Intercept setup as a 'Value from JavaScript' as described on the page I linked:
Value from JavaScript: This option captures custom JavaScript from your site. The specified value needs to be a JavaScript expression/call.


Thanks Tom! I was thinking we need to send the data somehow to Qualtrics. Just declaring the variables did the trick.


Hello regatron can you share the code that fixed the problem ? what do you mean by "Just declaring the variables did the trick."


Hello, were you guys able to fix this problem? I'm facing the same issue and can't find this Qualtrics object anywhere in the page.


Leave a Reply