Google reCAPTCHA v2 Integration

Integrate Google reCAPTCHA v2 to enhance your form's security by verifying users are not bots.

What is Google reCAPTCHA v2?

Google reCAPTCHA v2 is a security measure that requires users to click an "I am not a robot" checkbox before submitting a form. This helps in distinguishing genuine users from automated bots.

Setting Up Google reCAPTCHA v2

1. Obtain reCAPTCHA Keys

  1. Navigate to the Google reCAPTCHA Admin console.
  2. Provide a memorable name in the "Label" field.
  3. Select "reCAPTCHA v2" and then the "I'm not a robot" Checkbox option.
  4. Add your domain under "Domains".
  5. Click "Submit" to receive your "site key" and "secret key".

2. Configure Jamform

  1. Go to the "Advanced Setup" section in your Jamform dashboard.
  2. Enter your reCAPTCHA "secret key" into the "reCAPTCHA secret key" field.
  3. Click "Update" to save the configuration.

3. Update Your Form

  1. Add the Google reCAPTCHA script https://www.google.com/recaptcha/api.js to your form's HTML page
  2. Insert a div with class g-recaptcha and data-sitekey with the site key generated in step 1.

Example HTML:

<html>
  <head>
    <script src="https://www.google.com/recaptcha/api.js" async defer></script>
  </head>
  <body>
    <form action="YOUR_JAMFORM_ENDPOINT" method="post">
      <!-- Other form elements -->
      <div class="g-recaptcha" data-sitekey="YOUR_SITE_KEY"></div>
      <button type="submit">Submit</button>
    </form>
  </body>
</html>

_Notes:

  • Replace "YOURSITE_KEY" with the actual site key provided by Google. Ensure you use the site key, not the secret key, in the form's HTML. Remember, the secret key is confidential and should not be shared or exposed in your HTML code.
  • The g-recaptcha-response field will not show up in submission emails or webhook data.