Spam protection

reCAPTCHA

reCAPTCHA is Google's CAPTCHA service. v2 shows a checkbox, v3 scores visitors invisibly from 0.0 to 1.0, and Enterprise is the Google Cloud version.

Also called: Google reCAPTCHA, reCAPTCHA v2, reCAPTCHA v3, reCAPTCHA Enterprise

reCAPTCHA is the most widely used CAPTCHA, run by Google. It comes in three forms that you set up differently.

v2: the checkbox

The visitor ticks “I’m not a robot” and sometimes picks images. When they pass, the widget adds a hidden input called g-recaptcha-response to the surrounding form, so a normal submit carries the token with no extra code.

v3: the invisible score

v3 shows no widget. Your page calls grecaptcha.execute() with your site key and an action name, receives a token, and sends it with the form. When the server checks the token, Google also returns a score between 0.0 (very likely a bot) and 1.0 (very likely a person). Google recommends 0.5 as a starting threshold, and you can raise it when more spam gets through or lower it when real visitors are blocked.

Because there is no widget, nothing puts the token into the form for you. You have to add it in JavaScript before submitting.

Enterprise

reCAPTCHA Enterprise is managed in Google Cloud instead of the classic reCAPTCHA admin console. It has no secret key. The server asks Google to create an assessment for each token, using your own Google Cloud project. Enterprise keys come as checkbox keys (like v2) or score-based keys (like v3).

Verify on the server

Tokens are single use and expire after a short time, so a token has to be checked once, soon after the visitor gets it. Always verify on the server, never only in the browser.

In StaticForm

All three versions send the token in the g-recaptcha-response field. In the form settings you choose the reCAPTCHA type and enter the secret key; for Enterprise you enter the key ID, Google Cloud project ID and an API key restricted to the reCAPTCHA Enterprise API. For v3 and score-based Enterprise keys, StaticForm rejects a submission when the score is below the form’s minimum score, which starts at 0.5. The JavaScript helper loads the script and generates a fresh v3 token on every submit.

Learn more