Is there a way to detect Qualtrics via JS? | XM Community
Skip to main content

I am writing some code that needs to check if Qualtrics is "running". Is that possible?
i.e. if (QUALTRICS ==== LOADED) then ...

Actually, I have managed to answer my own question...
if (window.QSI != undefined) {
// DO SOMETHING
}
This code will act as a "loaded" trigger if you need something to happen once Qualtrics is loaded.


I'm just wondering about the use case of this.
If it's within the survey scenario, wouldn't the Qualtrics' builtin functions suffice?


Basically, we have a feedback button on our website that is unclickable if Qualtrics fails to load, so I wanted to be able to wrap it in a piece of code that basically check Qualtrics has loaded, so that the button displays (i.e. can be used), or stays hidden if Qualtrics doesn't load (i.e. is NOT usable).
The button triggers the survey BTW :)


Oh. Okay. Makes sense. I was wondering why you would need something like this in the survey itself.
Thanks.


Leave a Reply