Referral Form Best Practice

Referral Form Best Practice

Does anyone have any knowledge on creating a Referral Tracking program?  I have a few questions I am struggling with.

What we hope to accomplish

We are hoping to create a Referral program that allows us to:

  • Have a form that we collect information on both the person who referred someone and the person they referred.
  • The ability to track how many people a person refers and whether or not those people had opportunities created.
  • We want to send an email rewarding someone who referred a person and that person became an opportunity.

What we currently have:

We can't seem to figure out how to accomplish this.  Right now we have the below form:

Referral Form_.JPG

This form will treat the person referred (Referral Information form section above) as the person who filled out the form and therefore will auto-create a lead in Marketo and Salesforce through a Marketo smart campaign flow action.

The person who referred someone (the real person who filled out this form) puts their information in the "Your Information" section.  We custom fields in Marketo called Customer First Name (Your First Name above), Customer Last Name (Your Last Name above), Customer Email (Your Work Email above), Customer Company (Your Company above), and Customer Referral Reason (Why are you referring this person above).

This means when the person who was referred (Referral Lead) is created they will have the Customer fields (above) populated with the person who referred them.


With the program outline above we can track who is a referral lead and if they end up having an opportunity.

With the program outline above we cannot track how many people a person has referred.

With the program outline above we cannot automatically send an email to the person who referred someone who now is an opportunity.

Any ideas?

Level 10 - Champion Alumni

Re: Referral Form Best Practice

This is a complex process. I recommend researching this topic here because others have answered it before. You may have to create custom jquery and SFDC work to enable what you want to have happen.

Level 10 - Community Moderator

Re: Referral Form Best Practice

Nate, the general pattern here is what we can call Post-Map-Repost.  After the form's first submit (in the onSuccess handler) you remap the field values so that a different lead (the referrer) owns the form, then post it again.  An example is here and I know I linked to this demo in an earlier Community post.

Re: Referral Form Best Practice

Hi Sanford,

Could you explain a little bit more in depth of how the demo works and what you mean by Post-Map-Repost?

Level 10 - Community Moderator

Re: Referral Form Best Practice

OK.  Consider that the referral process consists of two data storage steps. 

  • Storing the new lead (the referral) in Marketo as you would any new lead, also including the referrer's email address as a field on the referral's lead record.
  • Augmenting the referrer's lead record with information about the referral, so they can get credited/contacted for it.

So basically you're talking about two form posts, using many of the same fields but framing them in different ways.

Since the Forms 2.0 API gives you great access to a JavaScript object that holds all field names and values that were entered on a form (even after a form was successfully submitted), you can listen for the form to be submitted, then manipulate (map) some field values to different field names, then post the form again.

For a prominent example, the built-in form field `Email` (lead's email address) dictates which lead record the rest of the fields will be written to (it's the way Marketo find/dedupes leads).  So you could create a form with `Your Email` and `Your Friend's Email` fields, and switch who is the lead and who is their friend and make two form posts even though the person just clicked a single button.

Re: Referral Form Best Practice

Challenge in Marketo:

A lead goes to a referral page and fills the form. If we use standard fields in Marketo, the original lead cookie will be over-written and tracking would start for the new lead that was referred. And, going ahead, all activities for the lead who gave referral would be tracked under activity log of the lead who was referred. This can have a major impact on your reporting.

Recommend Solution:

- We create a referral form which has separate fields for the user who is being referred and not the one who is referring. After someone gives a referral, we use a webhook to create a new lead.

- Once this new lead is created, we update the information in MKTO and send them to sales team.

- After this, we send an auto-responder to the lead who gave us the referral.

We have readymade Referral program packages for MKTO which can be deployed in 2-3 days. Drop us a line at and I can share more details.     

Level 10 - Community Moderator

Re: Referral Form Best Practice

Alok, that problem's easily avoided by managing existing cookies correctly: there are Solved community threads on this topic. It's only a problem if you're not aware of it when developing.

I don't agree this is a place for webhooks (by which you must mean calling back into the Marketo API using a webhook).  Single-use (non-batchified) use of the APIs in response to interactive activities should be discouraged.  It's not only about legitimate activity but malicious use as well: if I know a form uses up an API call I whenever submit it, for example, I've got a DoS attack vector ready and waiting.  Hackers dream of a DoS attack that only requires 10,000 TCP connections over the course of a day!

Re: Referral Form Best Practice

Hi Sanford, can you please direct me to some of the resources related to management of existing cookies? I am trying to search but can't find it.

Level 10 - Community Moderator

Re: Referral Form Best Practice

I know Dan Stevens started one of the threads. You'd have to search further.

Not applicable

Re: Referral Form Best Practice

There is a benefit to keeping cookies in tact. Every time the customer makes a new referral, their original information is retained. This saves the customer effort in inputing the data and makes behind the scenes tracking (and crediting the customer with the referral) easier.