I've been digging around to figure out how to handle a multi-part referral form. The basic flow is:
Having cobbled together a solution, I have the second form set up using this solution:
<script>
//add a callback to the first ready form on the page
MktoForms2.whenReady( function(form){
//add the tracking field to be submitted
form.addHiddenFields({"_mkt_trk":""});
//clear the value during the onSubmit event to prevent tracking association
form.onSubmit( function(form){
form.vals({"_mkt_trk":""});
})
})
</script>
(Cribbed from https://developers.marketo.com/blog/clearing-marketo-tracking-cookie-from-forms-2-0-submission/ )
This works insofar as I end up with two separate people in Marketo's database - one from each form. But what I've found is that the second form still seems to set a new cookie on the person, so the confirmation page visit is attributed to the referred prospect, as opposed to the partner initiating the referral.
How can I keep the tracking cookie from Step 1 intact throughout this process and never set one during Step 2?
Solved! Go to Solution.
This works insofar as I end up with two separate people in Marketo's database - one from each form. But what I've found is that the second form still seems to set a new cookie on the person
I doubt it's creating a new cookie in the browser, if the confirmation page is on the same domain as the landing page (or a subdomain of the same parent domain)
More like it's continually reassociating the same cookie.
You can disable Munchkin tracking on the confirmation page.
Also, it isn't so necessary to have these be different forms and different pages. Rather, have the same form loop and repost N times (once for each referral) and then post the form as the referrer last. That sidesteps any worries about what happens on the confirmation page.
This works insofar as I end up with two separate people in Marketo's database - one from each form. But what I've found is that the second form still seems to set a new cookie on the person
I doubt it's creating a new cookie in the browser, if the confirmation page is on the same domain as the landing page (or a subdomain of the same parent domain)
More like it's continually reassociating the same cookie.
You can disable Munchkin tracking on the confirmation page.
Also, it isn't so necessary to have these be different forms and different pages. Rather, have the same form loop and repost N times (once for each referral) and then post the form as the referrer last. That sidesteps any worries about what happens on the confirmation page.
Thanks, Sanford. You are correct that it's no replacing the cookie, but rather re-associating it with the referred lead's profile. I disabled tracking on the thank-you page, but that is still re-associating the cookie.
Unfortunately, I can't re-use the same form. We need different information from referrers and their provided leads, and workflow-wise, it's going to create problems if we ask for the referrer information last, since we need to attach that person's email address to a hidden field on the referred lead's profile.
Do you have any other thoughts or am I stuck with having to pull in a proper developer to build this all against the API?
Thanks,
Nik
Sanford - I owe you an apology. Your solution is correct. Things were compounded by a syntax error in my template that cause the JS code above to be effectively commented out. Oops! It seems that doing that AND disabling Munchkin on the confirmation page is necessary to keeping everything going properly.
OK, great!