Hi Sanford,
Im not expert but from hours of testing, just clicking the link from the email wouldn't do the trick. It seems that somehow after visiting SM Marketo was not able to associate the email to the final landing page. The minute I added a LP before the survey, the problem was fixed.
Would you know why this occurred?
I explained this above.
When you click a link in an email and the destination page is running Munchkin, the lead is associated automatically (that is the reason the mkt_tok URL param is added).
When you click a link in an email and the destination page is not running Munchkin (i.e. SurveyMonkey), the lead is not associated because the destination page has no idea what to do with the mkt_tok.
If you can forward the the mkt_tok back to your site, then the association can be run again as originally expected.
So Sanford, Is the following correct for this scenario?
a> If Survey Monkey does carry over mkt_tok, there is no need to have any Marketo landing page before Survey Monkey page.
b> If it does not (most likely here), just have the (tracked) link in the (Marketo) email go to a Marketo landing page which will simply redirect to the Survey Monkey page. Is this correct?
regards
Rajesh
So Sanford, Is the following correct for this scenario?
a> If Survey Monkey does carry over mkt_tok, there is no need to have any Marketo landing page before Survey Monkey page.
b> If it does not (most likely here), just have the (tracked) link in the (Marketo) email go to a Marketo landing page which will simply redirect to the Survey Monkey page. Is this correct?
Yep, that's right.
The question is how to most efficiently and reliably accomplish (b). Whatever is doing the associating -- standard Munchkin init() or form -- must complete its HTTP request. The response in itself is not important, but the request must be complete.
A form has the theoretical advantage of having a built-in confirmation of request-response complete (the onSuccess handler that you can hook into). But it has the disadvantage of creating an extra Filled Out Form event that is going to look pretty strange coming right before another form fillout (the survey). I'm not above adding extra events like this when it's the only way, but it's not a perfect fit here.
Munchkin is by default asynchronous. Meaning you can't simply run Munchkin.init() followed immediately by the document.location because Munchkin will not have finished bootstrapping and loading.
If you are not comfortable ensuring Munchkin runs reliably, you can use the form, but just be aware that it's not ideal.
Hi All,
I have decided to try the JS path and all seems to be working excellently. Thank you all very much for your assistance
<script src="//app-ab02.marketo.com/js/forms2/js/forms2.min.js"></script>
<form id="mktoForm_2190" style="display:none"></form>
<script>MktoForms2.loadForm("//app-e.marketo.com", "999-XXX-999", 1272, function(form) {
MktoForms2.whenReady(function (form) {
form.submit();
});
});
MktoForms2.loadForm("//app-sjst.marketo.com", "785-UHP-775", 1057, function(form) {
//Add an onSuccess handler
form.onSuccess(function(values, followUpUrl) {
// Take the lead to a different page on successful submit, ignoring the form's configured followUpUrl
location.href = "https://google.com/?q=marketo+forms+v2+examples";
// Return false to prevent the submission handler continuing with its own processing
return false;
});
});
</script>
Regards
Matt
You certainly don't want to load the form twice. That defeats the purpose.
MktoForms2.loadForm(..., function(form){
form.onSuccess(function(values,followUpURL){
location.href = '{your_survey_monkey_url_here}";
return false;
});
form.submit();
});
Just when I thought I could put this one to rest and crack a beer
Sorry Sanford, don't know if im tired, but when I try this edit it doesn't work.
Can you please be a little more specific on what I should be changing.
Thanks
Matt
<script src="//app-ab02.marketo.com/js/forms2/js/forms2.min.js"></script>
<form id="mktoForm_2190" style="display:none"></form>
<script>
MktoForms2.loadForm("//app-ab02.marketo.com", "{munchkinId}", 1272, function(form) {
form.onSuccess(function(values, followUpURL) {
location.href = '{surveymonkey}';
return false;
});
form.submit();
});
</script>
Where {surveymonkey} is the SM URL and {munchkinId} is your actual AAA-BBB-CCC ID, which you've been obfuscating.
Hi Sanford and Matthew Varone,
1/ You can set up the follow-up page when defining the form in Marketo, you do not need to do it in the JS.
2/ Matthew, do not forget to replace the 1272 form ID from my example into you own form ID (apparently 2190).
So the code should like this :
<script src="//app-ab02.marketo.com/js/forms2/js/forms2.min.js"></script>
<form id="mktoForm_2190" style="display:none"></form>
<script>
MktoForms2.loadForm("//app-ab02.marketo.com", "999-XXX-999", 2190, function(form) {
MktoForms2.whenReady(function (form) {
form.submit();
});
});
</script>
There is an even simpler version that may work, but I am not sure, as it does not seem to wait until the form is completely loaded, since it does not use the whenReady method :
<script src="//app-ab02.marketo.com/js/forms2/js/forms2.min.js"></script>
<form id="mktoForm_2190" style="display:none"></form>
<script>
MktoForms2.loadForm("//app-ab02.marketo.com", "999-XXX-999", 2190, function(form) {
form.submit();
});
</script>
In red are the items you need to change from your own environment.
-Greg
1/ You can set up the follow-up page when defining the form in Marketo, you do not need to do it in the JS.
Unless you're using the same form for multiple possible destinations, yes.
There's still a race condition here, btw. Unlikely as you are to encounter it, there is actually no contractual (in the programming sense) guarantee that the Munchkin cookie will exist at the time you submit the form.