AnsweredAssumed Answered

Referral Form with Multiple Referrals

Question asked by Nik Friedman TeBockhorst on Oct 18, 2019
Latest reply on Oct 21, 2019 by Sanford Whiteman

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?

Outcomes