Using reCaptcha with the Forms Widget

reCaptcha is a Google service that helps websites eliminate bots and spammers from submitting forms or taking certain actions on their website.  The reCaptcha control in the Form widget allows for easy integration with your Percussion hosted forms. The reCaptcha control compliments the HoneyPot form control in controlling the Spam that your forms generate. 

Setting up reCaptcha 

Step 1.  Create a reCaptcha account

  • The first step is to visit https://www.google.com/recaptcha and create a reCaptcha account for use on your website. 
  • Once your account is created, create a site using the v2 Checkbox style of reCaptcha.
  • You will be provided a Site Key, and a Secret Key
  • For domains, add the following host names:
    • host name of your percussion cms editor
    • host name of your published website (Create an entry for www.yourdomain.com and yourdomain.com without the www)
    • host name of any staging or development websites
    • if testing the site on a local machine, and localhost as a domain name
  • Copy and save your Secret Key and Your Site Key.  You will need them when setting up your form.

Step 2. Setup your form

  • Edit the Form widget on the Page that contains your form.
  • Add a reCaptcha control to the form.  Position it above your submit button. 
  • Edit the properties of the reCaptcha form field.
  • Add the Site Key that you saved earlier to the Site Key field in the Layout properties. 
  • Save the form. 

Step 3.  Configure your DTS instances

Note:  This configuration may need to be done by your System Administrator. 

For each Production or Staging DTS server that you have deployed:

  • Edit or create a <InstallDir>/Deployment/Server/conf/perc/perc-form-processor.properties file
  • Add the following properties:

recaptcha.secret=Your Secret Key Provided by Google

recaptcha.on=true

recaptcha.url=https\://www.google.com/recaptcha/api/siteverify

  • Save the properties file
  • Restart the DTS instance

Step 4.  Publish the Page hosting your form

  • Publish the Page hosting your form. 
  • Try to submit the form without completing the reCaptcha field
  • Complete the reCaptcha field and you should be able to submit the form. 

Additional Information

  • Forms can't be posted in preview or the editor, but the reCaptcha field will still be displayed.
  • reCaptcha provides several advanced properties and options including several JavaScript call back options.  The Layout properties of the reCaptcha control exposes these properties in the event that you want to take advantage of them.
  • More information on reCaptcha for developers can be found in the Google documentation for the service. https://developers.google.com/recaptcha/intro
  • The secret key in the properties file will be encrypted automatically when the DTS is started. If you ever need to change the key, just replace the text, including the "ENC(" portion of the string with the new key.