WiscWeb - Adding CAPTCHA to Gravity Forms
- Support: Support is not available from the UW-Madison Google team for non-core apps. We recommend the following for assistance:
- Recommendation: Use a departmental service account when using non-core apps to share ownership of data and avoid losing access to data owned by a former employee/student.
- What is CAPTCHA?
- Creating a reCAPTCHA Account
- Adding reCAPTCHA Keys to WiscWeb
- Including CAPTCHA in Gravity Forms
CAPTCHA is a simple test that allows the browser to distinguish between a human user of your form and machine input by a bot. Adding it to your web forms will allow you to restrict submissions by bots, which will cut down on the amount of spam emails that come in to your department.
Here's an example of reCAPTCHA, the form we encourage you to use with your WiscWeb forms:
Note: We highly encourage you to set up your CAPTCHA account using a service account rather than a personal account. That way, if you were to leave your position, your team can still access and modify the information in the account. These steps will assume you are using a service account for this process.
- Open a new incognito or private browsing window in your browser
- Navigate to https://www.google.com/recaptcha/admin
- Type in your NetID email (netID@wisc.edu) into the "Email or Phone" field and click the blue Next button (reminder: you'll eventually be logging into a service account)
- You should be redirected to the Shibboleth login screen. Login with your NetID credentials
- You will be asked which account you'd like to sign into. The various options will appear in a bulleted list. Select the service account you'd like to set up the CAPTCHA account with.
- If asked what type of CAPTCHA account you want, choose reCAPTCHA enterprise.
- You should now be logged in to Google's reCAPTCHA tool with your service account. If not already brought to the "Register a new site" page, click on the plus icon in the top right corner of the screen.
- In the Label field, type in the name of the website you'd like to add CAPTCHA for
- Choose the first option, Challenge (v2), from the reCAPTCHA type list and select the "I'm not a robot" option
- Click the plus sign (+) in the Domains list to add a new URL for your reCAPTCHA account (no need to add the https://).You may add more than one domain, if desired.
- Note: If you have not yet launched your WiscWeb site, you will have to add your production domain to this list when you launch.
- In the Google Cloud Platform section, add a project name and choose an organization this should fall under. If you have not yet created a Google Cloud Platform (GCP), you will need to request one from the Cloud Services Team (i.e. don't use the default wisc.edu account). Once setup, your new GCP account should show up as an option in this list.
Note: For UW-Madison websites, it is highly recommended that you get an official, supported GCP project, provisioned by the DoIT Cloud Services team. A UW Cloud Team provisioned GCP account/project will have a Google group as its primary Owner/principal, making it easy and simple to provide appropriate team access to the GCP project. Owners will have the ability to manage the users in the group.
- Click the blue Submit button
- You will be brought to a new page which should show the new reCAPTCHA keys that you will need to copy and paste into your WiscWeb project (instructions below)
In order to be able to add CAPTCHA to your WiscWeb forms, you will have to first adding the reCAPTCHA Site and Secret Keys to your Gravity Forms settings.
- Copy the Site Key from your recently created reCAPTCHA account
- Navigate to your WiscWeb Dashboard from a different browser session. In this window, make sure you are logging in with your personal account credentials.
- Click on Forms from the left navigation menu
- Choose Settings
- Choose reCAPTCHA
- Locate the reCAPTCHA Settings fields
- Paste in site key into the Site Key field
- Go back to your other browser window and copy the Secret Key from your new reCAPTCHA account
- Navigate to your WiscWeb browser window and paste the secret key into the Secret Key field in the reCAPTCHA Settings
- Click the blue Save Settings button
In order to include CAPTCHA in one of your forms, you will simply need to add this field to the form in your editing environment.
- In WiscWeb, navigate to Forms by selecting it from the left navigation menu in the Dashboard
- Choose the form to which you'd like to add CAPTCHA functionality
- From the Editing environment, scroll down to where you'd like to add the CAPTCHA element (usually at the very bottom of the form).
- From the menus on the right, open the accordion for Advanced Fields
- Click and drag the CAPTCHA button and place it where you want in the form
- If everything is set up correctly, your CAPTCHA field will show up as expected:
- Make sure to click the blue Update button to save your changes to the form
- If you do not copy and paste the entire site or secret key into the Forms Settings, you will see an error. Make sure you are copying and pasting the entire key before you continue.
- If you do not save your changes in WiscWeb, the process will not work. Make sure to select the Save Settings button after pasting in your keys and make sure to select Update after adding the CAPTCHA button to your form.