Can someone explain the honeypot code for me? | XM Community
Skip to main content

I’m running a survey that’s been targeted by some bots and I came across the honeypot method. The code below was posted several times but I’m confused with what I do with it and to test it.

Qualtrics.SurveyEngine.addOnload(function() {
jQuery("#"+this.questionId).prev('.Separator').hide();
jQuery("#"+this.questionId).hide();
});

 

Is the above correct? Do I simply copy and paste that into the JavaScript after deleting all the other stuff? Do I have to make edits to it? I don’t code so I don’t know if that messes things up. And after I do that, do I simply write my question and only bots will see it?

This code snippet is designed to hide both the current question and a preceding separator element in a Qualtrics survey. The exact context in which this code is used and its effects on the survey's appearance and functionality would depend on where it's placed within the survey script and how it interacts with other elements and scripts in the survey and how it is being used.

I’d suggest to create a text entry question where you will need to ask something in brief and bots can be detected. Additionally, there are multiple ways to detect bots like enabling bot detection in Qualtrics’s survey, create embedded field to capture time taken a respondent and flagging if the time is much less.

Let me know if this helps!


Leave a Reply