Turnstile Questions

Hi, I have two questions about turnstile and I hope somebody can bring me a solution.

1- I have forms made to load as popup on the product page when customer clicks on the button of the form of my store and they are protected by Turnstile. The thing is that every time some customer visits the product page turnstile captcha requests are being loaded for those forms. This is causing that in my cloudflare → turnstile account I see a lot of requests with the action called as the forms every time a user visits the product page without clicking the form button. You could actually say that it is scanning every user regardless of whether they open the form to enter the data or not. How could I make it so that for these forms turnstile is executed after opening the popup that contains them?

2- In the google chrome console I get the message that it is being preloaded in a wrong way. Specifically I get this:

“The resource https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/g/cmg/1/wh0E0SXYnx6pTBdJW/l926I+PRUplRdtQz3K9lHXs/s= was preloaded using link preload but not used within a few seconds from the window’s load event. Please make sure it has an appropriate as value and it is preloaded intentionally.”

Another error that i can see in the console is “GET https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/g/pat/8155d9cd6cea6675/1697181950035/1872d0d435d7bab3fdf7ed85734faf91dd97dfcbe5a612466ebb60ae7bee04be/1eOEyXJSst_oVJd 401 (Unauthorized)” when is loading turnstile on product page popup forms.

I hope someone can provide a solution to these two questions because I am going crazy looking for the solution to this.

I have the same issue.

1 Like

Hi, someone from cloudflare can solve this?

Any info on this?

As you can see, no one wants to solve the problem. @matvejs16

Same here

Same here

  1. Set execution="execute" and then call turnstile.execute() once the modal is opened. Turnstile can’t automatically know that the form is invisible to the user, so you need to do it manually.
  2. The preload warning is normal and the 401 error is because it’s requesting a PAT - both of these are intended and unrelated.

Hi @leodeveloper,
could you please elaborate on how we can delay Turnstile rendering until the modal window is open?

In my case, it opens on button click - then content block with CF7 and Simple Turnstile in it

You have already answered good part of my questions in a different thread, but could you please have a look at your convenience?
Especially the part related to loading api.js multiple times, whereby the 1st is shooting 302 and the 2nd – 200
The number of (?) server-side validation attempts (correct me if I’m wrong) is high and some of them are taking ages link to webpagetest.org

Many thanks!

You need to somehow extend your micro-popups plugin to do what I said. How? No idea, I have no idea how that plugin or wordpress in general works.

That’s because when you load the Turnstile JS located at https://challenges.cloudflare.com/turnstile/v0/api.js it redirects to a versioned file (currently /turnstile/v0/g/1b3559406bc8/api.js). Getting a 302 and then 200 is expected and has nothing to do with multiple loads.

? What are you trying to say? That Turnstile is slow?