Google reCaptcha v3 Fails on Submission | Community
Skip to main content
Level 1
December 20, 2024
Solved

Google reCaptcha v3 Fails on Submission

  • December 20, 2024
  • 1 reply
  • 1892 views

Hi everyone,

We're encountering some inconsistent issues with Marketo recaptcha. We're getting the error

{message: "Captcha field missing in form", error: true, errorCode: "400"}

on form submissions for certain pages, while others work fine.

 

For example, filling out this form in Chrome (assuming you've accepted all cookies) will generate the error:

 

https://www.datadoghq.com/dg/apm/app-suite-demo-b/#request-a-demo

 

but it seems to work in Firefox.

And this page seems to work on both browsers for some users, but not others

 

https://www.datadoghq.com/dg/monitor/frontend-demo-dem/b/#request-a-demo 

 

Could anyone provide some insight on how to debug this? I can see all the scripts loaded and the the recaptcha endpoint returns a 200 after hitting the submit button google.com/recaptcha/api2/reload?k=... on both pages.

TLDR; both pages are basically identical, except for different marketo form IDs.

 

Thank you!!

Best answer by SanfordWhiteman

You’ll find the cause is that you have multiple forms (3 different form IDs) on the page.

 

The builtin reCAPTCHA feature isn’t supported with multiple forms at once. It only works when the race condition — that is, the race to see which form descriptor loads first — works out in your favor.

 

You can fix it with custom JS (look for my post about loading forms from different instances, it’s the same general approach).

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
December 20, 2024

You’ll find the cause is that you have multiple forms (3 different form IDs) on the page.

 

The builtin reCAPTCHA feature isn’t supported with multiple forms at once. It only works when the race condition — that is, the race to see which form descriptor loads first — works out in your favor.

 

You can fix it with custom JS (look for my post about loading forms from different instances, it’s the same general approach).

Level 1
December 23, 2024

Thank you Sanford! True! That make sense...

I will check for a custom JS as you suggested and see how to fix that.

Thank you!!