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

Is there a way to detect Qualtrics via JS?

  • May 17, 2021
  • 4 replies
  • 127 views

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

Best answer by takuhii

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.

4 replies

  • Author
  • Answer
  • May 27, 2021

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.


Forum|alt.badge.img+22
  • Level 7 ●●●●●●●
  • May 27, 2021

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


  • Author
  • May 27, 2021

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


Forum|alt.badge.img+22
  • Level 7 ●●●●●●●
  • May 27, 2021

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