Overview
Often, a contact form is used to gather consistent data from contacts reached through your marketing activities. Using a reCAPTCHA on a form is a way to tell humans and machines apart and improves the data gathered from the contact form.
To use reCAPTCHA for a contact form in your website, follow these steps:
- Get the reCAPTCHA data for your website from Google
- Embed or link the contact form into your website at the required location
- Add code to support reCAPTCHA into the form code
Before You Begin
To create the contact form with reCAPTCHA, you will need to create a Contact Form and a Contact List.
Contents
Click + to expand each section.
How to Get the Embed Code for a Contact Form
- In the portal, navigate to your Contact Form page.
- Take the opportunity to review the fields included in the form in Contact Fields.
- Review the contact lists you want to connect to the form in Contact Lists.
- Click Embed. The Contact Form Embedded window opens, displaying HTML code.
- Copy the entire code snippet from Contact Form embedded code, and paste it into a text editor to save for later.
- Keep the text editor open, and continue to How to Register for a reCAPTCHA with Google.
How to Register for a reCAPTCHA with Google
- Open the Google reCAPTCHA page in your web browser.
- Go the Admin Console.
- Complete the details requested, to register a new site.
Google gives you another string of code. Save this code along with your embed code and continue to How to Implement reCAPTCHA in your Website.
How to Implement reCAPTCHA in your Website
-
When you register for a reCAPTCHA, Google gives you the code to install it:

-
Put the API JavaScript file for reCAPTCHA in the header of your website. This is an example - note that it includes the first provided snippet of code:

- Paste the embed code for the form into your website, where required. See How to Get the Embed Code for a Contact Form for information on how to generate it.
-
Add a reference to the reCAPTCHA to the form tag:

-
Paste the second provided snippet of code into the form just before the submit code:

-
This is an example of finished code for a form:

Comments
Article is closed for comments.