Shopify themes, liquid, logos, and UX
Hello, I would like to use google recaptcha on my custom form on a custom page.
How to do it?
This is how to do it (assuming you know how to get the key). Add this script to the bottom of the liquid page of where you want to put your code. Change the xxx-site-key code to your own.
<script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" async defer></script>
<div id="re-captcha"></div>
<script>
var actCallback = function (response) {
$('#contactFormSubmit').prop("disabled", false);
$('#re-captcha').remove();
};
var expCallback = function() {
$('#contactFormSubmit').prop("disabled", true);
};
var onloadCallback = function () {
var widget = grecaptcha.render(document.getElementById("re-captcha"), {
'sitekey' : "site-key-codexxx", // Sitekey, Retrieving from reCaptcha
'theme': "light",
'callback' : actCallback,
'expired-callback': expCallback,
});
}
</script>
the code is worked but when submit the form it's show 404 error how to solve the issue
@Feddrow1 Did you get the solution for 404 as I am also facing the same issue after implementing the code.
Have you figured it out yet?
You can use shopify forms.
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025