Is there a way to detect Qualtrics via JS? | XM Community
Solved

Is there a way to detect Qualtrics via JS?


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

icon

Best answer by takuhii 27 May 2021, 10:32

View original

4 replies

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.

Userlevel 7
Badge +21

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 :)

Userlevel 7
Badge +21

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

Leave a Reply