reCAPTCHA
Add more security to the forms by implementing Google reCAPTCHA
Galaxy supports Google reCAPTCHA to help protect the website's forms (to protect the leads sent to the backoffice).
Its goal is to distinguish between human and automated robots, to avoid receiving spams
Overview
in the website configuration, enter the 2 API keys
in the theme code, include Google's reCAPTCHA library
when a user submits the form, ask reCAPTCHA library to verify the user. reCAPTCHA will give a token
This token needs to be sent with the lead data, with the key
g-recaptcha-response
Galaxy will ask Google if the token is valid
If everything is good, the lead is sent to the backoffice 🎉
If this token is invalid, Galaxy refuses the lead, and the call will fail
Backoffice configuration
There are 2 API keys to enter in the backoffice:

Implementation in the theme
Please always refer to the last documentation from reCAPTCHA, to know how to include the API, how to get the token, etc...
How to get the reCAPTCHA API Key
In the theme, this syntax will call the reCAPTCHA key from the website parameters:
{if=" '{{website.google_recaptcha_site_key}}' "}
{{website.google_recaptcha_site_key}}
{/if}
How to send the token to Galaxy
When sending the lead data, include in the data g-recaptcha-response
, with the token as the value.
Handling errors
In the data
response, make sure to accept the lead only if data.success
is true
Last updated