Hey,
I have embedded a couple marketo forms on my site and when trying to post the forms i get this error:
The forms are embedded on the site using the "normal" -embed type and are set to stay on the page after submitting the form. Please help. 🙂
EDIT: It seems that this only happens inside our companys local network, when i try it on my own phone the forms work fine.
I was able to replicate this error several times by going through the following steps:
1. Open page with Marketo form as a cookied Marketo lead.
2. Delete lead in Marketo
3. Attempt to submit form (greeted with the following error)
in console:
body of response from Marketo (the decoded JSON)
4. If I refresh the page once and try again, it works fine.
However, if I switch steps 1 & 2 the error does not occur. In other words, it only occurs if the page with the Marketo form is loaded before the lead is deleted in Marketo. I'm not sure why this is. The form cannot be submitted even after waiting a few minutes; the page must be refreshed so I'm guessing it has something to do with forms2.js adding some Javascript state that has to be flushed.
Hope this is helpful to your dev team as they're debugging. Just load a form, delete the lead associated with cookie on the page you just loaded, and then try to submit the form. I highly doubt this happens often to actual leads, but it'd probably be good to understand what's going on.
Thanks!
I too am seeing this error, but we're not using the embedded form. We're using a custom form posting to the leadCapture/save2 endpoint via Guzzle. The "Error getting form forwarding urls" part of the error message is vague and abstract and could be interpreted as an error from our server, however, the "Form not saved" part of the error is clearly an error message from the Marketo endpoint. Our server and script does not know if a form is saved or not. This does not happen every time, and happens across several different server instances in our environment. Some more detailed information about the error from Marketo would be nice to have here instead of this vague, undocumented error.
Are you going over the rate limit of 1 form post every 2 seconds? (This limit is per source IP so when you attempt a server-side form post you are severely lowering your capacity. The Forms 2.0 client-side API should be used instead.)
BTW this issue, as Micah encountered it, doesn't have to do with client-stored state exactly. It's that the garbage collector doesn't run on the server until the first "mismatched post" occurs. It's reasonable IMO that a post with a broken cookie (that is, a now-deleted cookie that was associated with a now-deleted lead) should not be serviced. in the absence of any other direction.
If you want to delete a lead and ensure that a cookie in a current pageview isn't broken, you should reassociate the cookie with a dummy lead on the server, then delete the lead. Then the cookie will still exist, even though the original lead doesn't.
Hi there, I feel like this is a server side error. I am having a hard time believing there is any way a local network config could cause a marketo server to return a 500 error (internal server error) with the message "Error getting form forwarding urls. Form not saved." My suspicion is supported by the fact I have tried submitting 2 different forms from 3 different networks (my phone mobile network via tethering, home wifi, and work wifi). Same result everywhere. In addition, there was a point where it was working perfectly, and I changed nothing, and now it doesn't work. I receive this error whether I use the official JS snippet they give you (directly embedding the Marketo form in the page), or build a form myself in JS (according to the documentation) and try to submit it that way.
Please post a link to your form embed code.
Hi there, thanks for the quick reply. Here is the embed code
<form id="mktoForm_1038"></form>
<script>MktoForms2.loadForm("//app-sj16.marketo.com", "825-DUM-524", 1038);</script>
And here is the custom JS I tried as well. The idea here is that I transplant the data from a styled form on our page (dummy_form) into a Marketo form and submit. This is the implementation I will eventually have to go with as we have to attach some custom hidden fields to the form, but in this example I am not attaching any hidden fields, only filling out the existing form fields. When trying this method, I made sure to comment out the above official snippet in case there was any conflict. Here is a pastebin link if you would rather view it formatted / syntax highlighted.
function validateAndSubmit(dummy_form){
var valid = true;
if( !validator.checkAll( dummy_form ) ) {
valid = false;
console.log('validation failed');
}
if( valid ) {
console.log('validation success');
MktoForms2.loadForm("//app-sj16.marketo.com", "825-DUM-524", 1038, function(form){
form.vals({
'FirstName': dummy_form['First Name'].value,
'LastName': dummy_form['Last Name'].value,
'Email': dummy_form['Email Address'].value,
'Phone': dummy_form['Phone Number'].value,
'Company': dummy_form['Company Name'].value,
'Website': dummy_form['Website'].value
});
form.onSuccess(function(values, followUpUrl) {
// prevent redirect to any followup URL
console.log('form submitted');
return false;
});
});
MktoForms2.whenReady(function (form) {
console.log(form);
console.log(form.vals());
form.submit();
});
}
}
No matter which method I use (the copy pasted HTML/JS snippet, or my own implementation), here is the error I get: puu.sh/n4aFR/876adcd145.png
Here is a screenshot of the console logs produced by the custom JS implementation. You can see the Marketo form object being printed out, the form.vals() printing out just fine, but then the 500 error like above. As you can see, the required fields (munchkinId and formid) are set: puu.sh/n4aB9/0e1ab271f0.png
Thanks in advance
Can't replicate this with your form.
Try it yourself here: MktoForms2 :: Form Forwarding URLs (nation.marketo.com/thread/5830)
Yeah, that works for me. It also works on a Marketo landing page. However, here is that exact form on my site, not working.
Does it have anything to do with the fact I am developing this locally (on localhost)? That ideally shouldnt effect anything, but it might be?
Works for me from localhost as well.
Can you send me the entire contents of your page? There must be something else in play.
Hey there, I deployed the page to a testing server and it works just fine using either method from above, and both are still broken on localhost. I am not too concerned with what is going on now as I know once the page is in production everything will be fine. If it worked in localhost for you as well, I am especially not concerned. Thanks for the help
OK. I too would not be concerned about the live form. Perhaps there's some outbound proxy messing with the form post, since it's not the use of localhost alone that's causing it.