How can I fix the endless reCaptcha loop after form submission?

How can I fix the endless reCaptcha loop after form submission?

Codemon72
Shopify Partner
4 0 4

After submitting a contact form the user gets redirected to an endless reCaptcha loop. 

This problem exists while using a preview link. 

It works if I disable "Google reCAPTCHA on contact and comment forms" in preferences but I don't want my customer to get spam.


How can I solve this?

Replies 10 (10)

Don
Shopify Staff
2787 199 396

Hi there @Codemon72!

 

If you can share a bit more info and a link to your store with me here I'd be happy to check this out with you. 

 

Would you be using an app or custom code for your contact page or form?

 

Have you tested this behaviour by going directly to your store page, rather than using a preview link to see if it's also present there?

 

The more information you can give us here the better we will be able to understand and help out.

 

If you can, try to check this out using a different browser, device, or connection and ensure you're using a browser that is supported for use with Shopify.

 

I look forward to checking this out with you!

Don | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

Codemon72
Shopify Partner
4 0 4

Hi @Don,

 

Browsers I've used: Firefox and Chrome (also inkognito mode).

 

The new custom code I created: 

 

 

<script>
    if (window.location.href.indexOf('contact_posted=true') > -1) {
      const successAlert = document.createElement('div');
      successAlert.classList.add('Alert_Form_Sent');
      document.getElementById('main').prepend(successAlert);
      setTimeout(() => { successAlert.classList.add('active') }, 1);
      setTimeout(() => { successAlert.innerHTML = '{{ 
      "contact.form.product_successfully_sent" | t }}'; }, 300);
      setTimeout(() => { successAlert.remove() }, 8000);
      }
</script>

 

 

 

On the regular / live page the problem does not exist.

I have the problem with the preview link that is created locally on my machine (with `shopify theme serve`) as well as with the preview link I created after uploading the modified theme.

As it is not my, but my customers' store I do not want to post the preview link here or share the name of the site.
Can I pm you directly?

Don
Shopify Staff
2787 199 396

Hi again, @Codemon72!

 

Thanks for getting back to me here with that info!

 

As we're not able to support the use of custom code like this here, I'm afraid you'd need to be able to troubleshoot any code you choose to add yourself.

 

You can revert changes you have made to any .liquid files like this via the admin as outlined here.

 

It might be the case that you can get some input on this from your fellow Community members, though they would likely need to access your store in order to check it out for you.

 

All the best!

Don | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

Codemon72
Shopify Partner
4 0 4

Update:
If I use the preview link that gets created on my local machine using `shopify theme serve` I occasionally get checked for being a robot, but then get redirected successfully and everything is fine.

 

The endless reCaptcha loop seems only to exist if I use the preview link created from an uploaded (not live) theme. At last it even persisted after disabling 'Google reCAPTCHA on contact and comment forms' in preferences.

 

Looks to me like a Shopify bug. Am I wrong?

Cava
Excursionist
33 0 16

Goodmorning @Codemon72 

I've just checked other stores other than mine and the problem is common, regarding both the account and the newsletter form.

Were you able to find a solution or is a bigger shopify bug?
Thanks!

Codemon72
Shopify Partner
4 0 4

Hello @Cava 

no, I found no other solution than to create a preview link from my local machine (`shopify theme serve`) and give this link to my customer for testing. I couldn't find any detailed documentation about this link so I kept that preview on and made sure to stay in the git branch with the theme improvements I wanted to show my customer.

It seems to me like a Shopify bug too, but I didn't receive any confirmation or denial from Shopify other than what Don wrote here.

nvassalo
Shopify Partner
5 0 2

They seem to be recognizing it now: https://github.com/Shopify/shopify-cli/issues/1636

nvassalo
Shopify Partner
5 0 2

@Don any official channel we can look up to stay informed about this? Thank you

Don
Shopify Staff
2787 199 396

Hi again @Codemon72!

 

Thanks for getting back to us here in the Community again.

 

If you're referring to custom code you have added to your theme yourself, this would not be something we can provide support for from here in Shopify.

 

If, on the other hand, you're referring to an issue in an unedited Shopify theme, or with the Shopify core itself (not involving custom code you have created yourself) then we can check this out in more depth with you!

 

Just reach out via our Help Centre here for account support and let us know if it's the core Shopify admin or an unedited Shopify theme you think there's an issue with so we can investigate any possible issues with them.  

Don | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

jamesauble
Shopify Partner
12 0 6

Testing the contact page has kinda been a mess for years. The Recaptcha is intermittent after disabling. I usually can only get reCaptcha v3 to disable then sometimes eventually v2 disables hours later. I'm often stuck in that loop when testing on a generated share link, but as you mentioned I have success testing it (with reCaptcha v2 even though it's disabled) using the shopify theme dev "Share your theme preview" link. Being that nearly every site out there wants a contact form, it would be really nice for Shopify to make this process better.