Yesterday I added Google ReCAPTCHA v3 in one of my client’s Shopify website, but I don’t think that it is working because he is still reporting to receive several spam e-mails.
I’ve followed Google’s guide, but I don’t know what to do for “Verifying user response” part of the guide. I’m not an expert in coding.
Basically I’ve added this code to the theme.liquid file
<script src="https://www.google.com/recaptcha/api.js?render=*site key provided by google*"></script>
And then I’ve added this part in the page.contact.liquid file:
<script> grecaptcha.ready(function() {
grecaptcha.execute('*site key provided by google*', {action: 'contact'}).then(function(token) {
...
}); }); </script>
Have I missed out something? Can someone help me to fix this issue please?
3
Answers
Try on this one.
https://community.shopify.com/c/Shopify-Design/Adding-Google-reCaptcha-v3-to-the-Shopify-contact-form/td-p/467787
If you are not familiar with editing code, the best solution is adding an app from shopify app store.
Unfortunately, any attempt to implement reCaptcha on a native Shopify contact form will not work. It may appear to work, as in the form submits and you see the stats in the reCaptcha admin, but it won’t actually be blocking any spam. The reason is that you can only implement the client-side piece in your theme, and in order to work, you must have both the client and server-side pieces in place and working. The server-side piece is what detects a failed captcha (i.e., a spam bot) and prevents the form from being submitted.
Implementing just the client-side piece might block some of the most unsophisticated spam bots that just see the captcha and stop, but it’s trivial to design a bot to bypass the client-side piece: that’s why the server-side piece is essential.
Also posted this answer on the Shopify forum thread linked by Chami, as people there are going in circles thinking it’s possible or thinking it’s working when it’s not. 🙂
Update: Since originally posting this reply, Shopify has built reCaptcha support directly into the platform, and it’s turned on by default. With this done, there’s no need to implement the frontend code either within the theme, as it will be included automatically:
https://help.shopify.com/en/manual/online-store/os/preferences#protect-your-store-with-google-recaptcha
According to this page (http://blog.ivertech.com/blog/why-google-recaptcha-v2-or-v3-does-not-work-on-shopify-contact-form), Google reCaptcha v3 cannot actually be implemented on Shopify.
Since Shopify already implements Google reCaptcha v2 by default, there’s really no need for you to implement v3. Some users from Shopify’s forum who claimed that they were able to implement reCaptcha v3 successfully were mistaken. They were actually seeing the effect of reCaptcha v2 implemented by Shopify by default.
More details can be found from the link above.