PennController for IBEX › Forums › Support › Adding reCAPTCHA before the experiment
Tagged: bots
- This topic has 5 replies, 3 voices, and was last updated 2 weeks ago by
metehanoguzz.
-
AuthorPosts
-
September 30, 2024 at 11:10 pm #11049
metehanoguzzParticipantHi everyone, I am trying to prevent bot submissions to my study.
Do you know if there is anyway of doing this like adding a reCAPTCHA at the beginning of the study? If you know any other ways of avoiding bots, I would be very happy to hear those.
Best,
Mete-
This topic was modified 1 year, 7 months ago by
metehanoguzz.
April 17, 2026 at 6:25 pm #11145
mtborneoParticipantHi, did you figure it out? I’m trying to do the same thing but I have no idea how
-
This reply was modified 1 month ago by
mtborneo.
April 17, 2026 at 7:26 pm #11147
metehanoguzzParticipantHi!
No, I could not figure it out. I used other measurements (RTs, attention check questions) to detect bots and remove them from the analyses.
If you ever figure this out, could you please let me/us know here?
April 20, 2026 at 10:01 am #11148
mtborneoParticipantHi! Thanks for replying! I wanted to avoid collecting those data and find a way of aborting the experiment if they fail the attention check, but as of right now I haven’t figured it out. I’ll let you know if I ever do lol
May 7, 2026 at 12:27 am #11154utkuturk
ParticipantThere are many ways to do it. You can either use “fake-captcha” or host your own pcibex and have a backend and api to do real captcha (overkill) or you can do mouse tracking.
I use mouse tracking and tell participants sometimes they might be asked to check a box. Bot mouse movements and human mouse movements are different, pcibex already has support for mouse tracking.
Fake catpcha:
– Go to any captcha picture generator website. get couple of captcha images. put the image file names and answer text in a csv file and create a template trials like this:
`
Template(“captcha.csv”, row =>
newTrial(“captcha”,
newText(“title”, “Human Verification”).bold().print(),
newText(“instruction”, “Type the characters you see in the image:”).print(),
newImage(“captchaImg”, row.img).size(250, 80).print(),
newTextInput(“captchaInput”).print(),
newText(“error”, “Incorrect, please try again.”).color(“red”),
newButton(“Submit”).print()
.wait(
getTextInput(“captchaInput”)
.test.text(new RegExp(“^\\s*” + row.answer + “\\s*$”, “i”))
.failure(
getText(“error”).print(),
getTextInput(“captchaInput”).clear()
)
)
)
)
`Real captcha:
– Or start hosting your own pcibex. add google/amazon script api to your page template ( <script src=”https://www.google.com/recaptcha/api.js” async defer></script>)
– Then add trials like this to your pcibex code and then verify the tokens in your backend.`
newTrial(“captcha”,
newText(“instruction”, “Please complete the CAPTCHA to continue.”).print(),
newHtml(“recaptchaWidget”,
“<div class=’g-recaptcha’ data-sitekey=’YOUR_SITE_KEY’></div>”
).print(),
newFunction(“checkCaptcha”, () => new Promise(resolve => {
const interval = setInterval(() => {
const response = grecaptcha.getResponse();
if (response.length > 0) {
clearInterval(interval);
resolve();
}
}, 500);
})).call().wait(),
newButton(“Continue”).print().wait()
)
`Mouse tracking:
– Add mouse trackers and a random checkbox to subset of your trials.
– Track TrialN in your experiments`
Header(
newVar(“TrialN”, 0).global(),
)
.log(“trialN_header”, getVar(“TrialN”))
`– When you create a template code for your filler or experimental trials, add an if statement like this and add mouse tracker start, randomcheckbox, and mouse tracker stop.
`
Template(“experiment.csv”, row =>
newTrial(“exp”,
getVar(“TrialN”).test.is(v => v % 20 === 0).success(
newMouseTracker(“mouse”).log().start()
),// rest of your experiment code doing normal experiment stuff…
// clear everything on the screen
getVar(“TrialN”).test.is(v => v % 20 === 0).success(
//some checkbox code
,
getMouseTracker(“mouse”).stop()
),`May 8, 2026 at 12:08 pm #11162
metehanoguzzParticipantHi Utku,
This makes so much sense! Thank you so much for your response. I will probably add the “fake captcha” to my future studies.
Best,
Mete -
This topic was modified 1 year, 7 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.