In reCAPTCHA v3, Google introduced a new concept called “Action”—a tag that you can use to define the key steps of your user journey and enable reCAPTCHA to run its risk analysis in context. Since reCAPTCHA v3 doesn't interrupt users, Google recommends adding reCAPTCHA v3 to multiple pages. In this way, the reCAPTCHA adaptive risk analysis engine can identify the pattern of attackers more accurately by looking at the activities across different pages on your website.
Code snippet:
<script src="https://www.google.com/recaptcha/api.js?render=reCAPTCHA_site_key"></script>
<script>
grecaptcha.ready(function() {
grecaptcha.execute('reCAPTCHA_site_key', {action: 'homepage'}).then(function(token) {
console.log('recaptchav3 executed');
});
});
</script>
How To
Take the code above and paste it into key pages on your site, especially your Home Page. Open the individual Page Inspector and select the HTML tab, then the Javascript tab. Copy/Paste in the code from above.
Replace reCAPTCHA_site_key with your site's unique Site Key.
Replace homepage with a simple lowercase (no spaces) value for the page.
i.e. aboutus, cart, help, etc...
DO NOT ADD THIS TO ANY FORMLOOM OR FORMSNAP PAGE!
This code is already added on these pages. There is no need to add it again.
0 Comments