SOLVED

Referral Form with Multiple Referrals

Go to solution
Nik_Friedman_Te
Level 2

Referral Form with Multiple Referrals

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?

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Referral Form with Multiple Referrals

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.

View solution in original post

4 REPLIES 4
SanfordWhiteman
Level 10 - Community Moderator

Re: Referral Form with Multiple Referrals

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.

Nik_Friedman_Te
Level 2

Re: Referral Form with Multiple Referrals

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

Nik_Friedman_Te
Level 2

Re: Referral Form with Multiple Referrals

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.

SanfordWhiteman
Level 10 - Community Moderator

Re: Referral Form with Multiple Referrals

OK, great!