Referral Form with Multiple Referrals | Community
Skip to main content
Level 2
October 18, 2019
Solved

Referral Form with Multiple Referrals

  • October 18, 2019
  • 1 reply
  • 4207 views

I've been digging around to figure out how to handle a multi-part referral form. The basic flow is:

  1. A partner/referrer fills out a form with their information
  2. They then fill out a form with the information of the propect/referred-person, pre-populating a hidden field with the email address provided in Step 1 so that they get credit for the referral
  3. They have the option to go back to #2 and repeat the process

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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman
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.

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
October 18, 2019
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.

NikFrAuthor
Level 2
October 21, 2019

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