A half solution is by spinning up a Cloudfront distribution and pointing the loadForm call to the dxxxxxxxxx.cloudfront.net URL.
This allows the loadForm call to succeed, but submit still fails as the iframe that forms2.js loads has a hardcoded marketo.com URL in the script that it runs, resulting in that call failing inside the iframe, and since the iframe handles submits, it still doesnt work.
Actually, you're still missing something. You were so confident I didn't have the heart/time to tell you.
Have you checked to see you're actually getting the form submissions?
Damn you are right. See my edited comment. The XDFrame iframe still hits a marketo.com URL. I saw the form load and got ahead of myself. Shoot. Submits still fail even though form loads
The solution was in my CodePen (the link I sent before works completely).
Upload the file /marketo-xdframe-relative.html (you can get it from the demo link) to your Marketo instance.
Then reference the path in setOptions:
And create a behavior + origin for that path.
(You could put the file on S3 or any other host, but to avoid more moving parts I would use Marketo.)
Awesome, definitely seems like it will work. My hack solution was edit forms2.min.js to point the iframe at my own copy of it with and edited script, but thats definitely not ideal. Good to know you can use MktoForms2.setOptions(...
I'm out of time today but ill report back tomorrow if this doesn't work.
Yep, you could build a custom forms2.js, but as you said, it's not ideal. There have been critical bug fixes and you end up outside the upgrade path. (As the user most likely to investigate bugs I can guarantee there are more to come, since I've been keeping a few to myself until I can recommend a fix!)
We are dealing with the same issue. Where in Marketo would you upload the marketo-xdframe-relative.html file? Also, could you elaborate on create a "behavior + origin for that path."
Any help is greatly appreciated.