Skip to content

Adding Google reCAPTCHA to ACEweb Pages

The Google reCAPTCHA option helps keep BOTs from creating bogus Name records in your database.

reCAPTCHA

Create Google reCAPTCHA Account

  1. Before you can add the reCAPTCHA to your ACEweb pages, you must create an account at Google ↗️.

  2. You will need to log into your Google Account.

  3. 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

  1. Enter the Site Key into the RecapSiteKey INI setting in the ACEweb.ini.

  2. Add the RecapURL and RecapSecret values to the AWSys.ini, in the [Main] section.

Settings in AWSys.ini

  1. The RecapURL value should be: https://www.google.com/recaptcha/api/siteverify

  2. 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:

  1. 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>

  1. Remove the hiddenRecaptcha lines. You also need to remove the comma from the line above.

    javascript
    hiddenRecaptcha:
    {
        required: function ()
        {
            if (grecaptcha.getResponse() == '')
            {
            return true;
            }
            else
            {
            return false;
            }
        }
    }

Remove Javascript

  1. 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 %>
  1. 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>
  2. Recompile person.awp after the changes have been saved.

Express Registration

Contact your ACEware technician for information on using reCAPTCHA on Express Registration templates.