Adding Google reCAPTCHA to ACEweb Pages
The Google reCAPTCHA option helps keep BOTs from creating bogus Name records in your database.
Create Google reCAPTCHA Account
Before you can add the reCAPTCHA to your ACEweb pages, you must create an account at Google ↗️.
You will need to log into your Google Account.
Information to enter/select:
- Specify a Label.
- **Select the reCAPTCHA v2 option.
- Enter your domain.
- Accept the terms of service.
- Click the Submit button.
- Copy the Site and Secret Keys. You will need to add these into ACEweb settings.
**If you select the v3 option, you will need to edit the javascript on person.awp. See the reCAPTCHA v3 section for more information.
ACEweb Setup
Enter the Site Key into the RecapSiteKey INI setting in the ACEweb.ini.
Add the RecapURL and RecapSecret values to the AWSys.ini, in the [Main] section.
The RecapURL value should be:
https://www.google.com/recaptcha/api/siteverify
The RecapSecret should be the secret key you copied when you set up the reCaptcha Account.
Current versions of person.awp have the reCAPTCHA v2 coding added to them. If it is not working properly on your page, contact your ACEware technician for information about updating your person.awp template.
reCAPTCHA v3
If you are using the reCAPTCHA v3 option:
- Replace this script:
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
with this one:
<script src="https://www.google.com/recaptcha/api.js?render=<%=Config.cRecapSiteKey%>" async defer></script>
Remove the hiddenRecaptcha lines. You also need to remove the comma from the line above.
javascripthiddenRecaptcha: { required: function () { if (grecaptcha.getResponse() == '') { return true; } else { return false; } } }
- Remove these lines:
html<% IF !empty(Config.cRecapSiteKey) AND inlist(this.Page.cMode,"NEWUSER","NEWALT","NEWUSERSIGNUP") %> <div class="g-recaptcha" data-sitekey="<%=Config.cRecapSiteKey%>"></div> <input type="hidden" class="hiddenRecaptcha required" name="hiddenRecaptcha" id="hiddenRecaptcha"> <% ENDIF %>
Add these javascript lines just above the closing
</head>
tag.javascript<script> function onClick(e) { grecaptcha.ready(function() { grecaptcha.execute('<%=Config.cRecapSiteKey%>', {action: 'submit'}).then(function(token) { var params={tokenName:token}; $.getJSON("weighScore<%=MapExt%>", params, function(data) { return data.passfail }); }); }); } </script>
Recompile person.awp after the changes have been saved.
Express Registration
Contact your ACEware technician for information on using reCAPTCHA on Express Registration templates.