Part of the fun of a new year is renaming all those folders with '2019', and then forgetting where you've put things. But in the spirit of spring cleaning, and keeping it that way (see our other post on how to do this), follow the steps below to prevent bots from submitting your forms using reCaptcha.
Setting up reCAPTCHA is quite simple, although the initial set up may require a Developer, as you will need access to the source HTML of your website.
First, you’ll want to navigate over to the reCAPTCHA site to register your domain and obtain your Site key and Secret key.
After clicking the My reCAPTCHA button in the upper right corner of the home screen, you’ll be asked to register a new site:
Enter a label if you’d like (if you leave it blank, the label will default to the Domain you enter in step 3) and the continue to step 2, Choose the type of reCAPTCHA. You can select Checkbox or Invisible and then add your desired Domain(s) below, following the instructions on the site. Please make sure these domains are also listed under CORS Settings in Mautic (the domain will need to be listed fully under CORS Settings in Mautic, so example.com may work for the reCAPTCHA domain, but you will probably need https://example.com, or https://www.example.com under CORS Settings in Mautic).
After accepting the reCAPTCHA Terms of Service, click Register, and you’ll be guided to a page that contains your Site key and Secret key, both of which you’ll need to complete the integration with Mautic. There will also be a code snippet that you’ll need to add before the closing </head> tag on your HTML Template (this is where you will potentially need a Developer – they will need to add the snippet in the editor of your website):
Next, you’ll want to navigate to reCAPTCHA on the Mautic Plugin Page (Settings>Plugins) and enter the Site key and Secret key in the appropriate fields, switch Published to Yes, then click Save & Close:
After you’ve enabled the reCAPTCHA Plugin, navigate over to Mautic Forms, and either create a new Form, or open an existing Form you’d like to add reCAPTCHA to. Under the Fields Tab, you’ll see reCAPTCHA has been added. Select it, and it will be added to the Form:
Set Show label? to No if you’d rather not have anything above the reCAPTCHA field in the Form. Once you’ve added it, it should look something like this in your Mautic Account: