Pardot Knowledge Base

Creating a Referral Form

Last Updated: Jun 30, 2016 | Print this Article
 
Whoa there, partner! This is an advanced topic, and requires an understanding of JavaScript. Please proceed with caution.

As a marketer, you may want to create a referral Form, which allows someone visiting your website (the referrer) to submit someone else's information (the referee). There's not an out-of-the-box way to accomplish this with Pardot, but this article will outline a way it can be accomplished using an autoresponder Email Template, Custom Fields, a Form Handler, a specially-prepared Layout Template, a Form (or a Form and a Landing Page), and some JavaScript.

This is a specialized implementation of the instructions for forwarding data from a Pardot Form post to a third party, found in this Knowledge Base article.

PLEASE NOTE: It is against Pardot's Permission Based Marketing Policy to send ANYONE unsolicited email. It will be necessary for you to clearly note, in an introductory autoresponder email sent to the referee, why the person was sent the email in the first place, and how he or she can opt out of receiving emails from you. Otherwise, your email sending IP's reputation may suffer, you may have a higher incident of spam complaints, and your ability to send emails with Pardot may be restricted. That said - proceed with caution.

Create New Fields

This process will require the creation of at least two new Custom Fields — one to hold the referee's email address, and one to hold the referrer's email address. You'd accomplish that using the instructions found here. Name the referee email field 'Referee Email,' set 'Type' to 'Text,' and if you're using a CRM, set the field to 'Use Pardot's value' — this will allow a prospect to refer multiple other prospects.
If you'd like more information for a referee than just the email address, you'd set up those additional Custom Fields the same way. Similarly, name the referrer email field 'Referrer Email,' set 'Type' to 'Text,' and set the field to 'Use Pardot's value.' This field will display the email address of the referrer on the referee's prospect record.

Create a List to Hold Referees Until They Opt In

To stay in compliance with Pardot's Permission Based Marketing Policy, you'll want to make sure that referees don't receive any emails from you until they've explicitly opted in. The best way to do this is to create a List - 'Referees - Not Opted In.' This List would be used as a suppression list for all emails you send. Once these referred prospects explicitly opt in, you can remove them from the List and send emails to them as you would your other prospects.

Create an Autoresponder to Send to Referees

To stay in compliance with Pardot's Permission Based Marketing Policy, you'll want to create an autoresponder Email Template (read more about creating an autoresponder Email Template in this Knowledge Base article) that outlines to the referee why they received the email - like, 'Hey, you were referred to us by %%Referrer_Email%%!', and how they can opt in to continue receiving emails from you - like, 'Just wanted to make sure you want to continue receiving emails from us! If so, please click here [custom redirect link with a completion action to remove from the 'Referees - Not Opted In' list]. If not, you don't have to do anything - we won't email you again.' You could also link to a Form with a completion action to remove the prospect from the 'Referees - Not Opted In' List if you'd like to gather more information.

Create Form Handler

The means by which the referee will become a prospect in your Pardot instance is a Form Handler. You can read more about how to create a Form Handler in this Knowledge Base article. For this Form Handler, you'll want to do the following:
  • Set the Form Handler to 'Kiosk/Data Entry Mode.' This will ensure that the person submitting the Form doesn't have his or her activity associated with the prospect they're referring. (fig. 1)
  • 'Disable Visitor Activity throttling and send auto-responder emails after every submission.' That way, all referred prospects will receive an autoresponder email asking them to opt in. (fig. 1)
  • 'Success Location' and 'Error Location' can be whatever you want - if this is set up properly, the page at the URL you enter for 'Success Location' will only be loaded in a hidden iframe, and the 'Error Location' won't ever be loaded. (fig. 1)
fig_1 fig. 1 - Referee form handler settings
  • Set up completion actions to add the prospect to the 'Referees - Not Opted In' List and to send him or her the autoresponder Email Template created earlier. (fig. 2)
fig. 2 fig. 2 - Referee form handler completion actions
  • Map the external field name Referee_Email to Email (similar for Referee_First_Name to First Name, Referee_Last_Name to Last Name, etc.). This will ensure the referee data gets associated with the referred prospect. (fig. 3)
  • Map the external field name Referrer_Email to Referrer Email (similar for Referrer_First_Name to Referrer First Name and Referrer_Last_Name to Referrer Last Name, etc.). This will ensure the referrer data is added to the referrer fields for the referred prospect. (fig. 3)
Referee form handler field mapping
fig. 3 - Referee form handler field mapping
  • Finally, copy the Form Handler endpoint URL to add to a custom script we'll include in the Thank You code for the Form that will be created later.

Create Layout Template or Modify Existing Layout Template

The Form (or the Landing Page on which the Form will be inserted) will need to use a specially-prepared Layout Template in order for this process to function properly. The instructions for preparing the Layout Template can be found in steps 1 and 2 of this Knowledge Base article, the important bits of which have been reproduced below:
  • In the Form tab of the Layout Template, copy and delete the highlighted code below:
fig. 4 - Layout Template Form Tab, editing step 1 fig. 4 - Layout Template Form Tab, begin
  • Paste that code above the opening form tag as below:
fig. 5 - Layout Template Form Tab, final fig. 5 - Layout Template Form Tab, final
  • Save the Layout Template. Remember to either apply this Layout Template to the Form itself (if the Form is being iframed onto an external page or used by itself) or to the Landing Page (if the Form is being used in conjunction with a Landing Page).

Create Form

The form will be created using the following steps (see these instructions for a more detailed description of the Form creation process):
  • In Step 2 of the Form wizard (Fields), all referee fields should be set to 'Always display even if previously completed' and 'Do not prefill.' This will ensure that the referee fields will be present and blank every time a referring prospect views the Form.
fig. 6 - Referee field settings fig. 6 - Referee field settings
  • When the Form's fields are set up properly, they'll look like figure 7 below:
Form field setup fig. 7 - Form field setup
  • In Step 3 of the Form wizard (Look and Feel), choose the Layout Template that you created earlier in these instructions. Keep in mind that if you're using this Form in conjunction with a Landing Page, you'll need to use that Layout Template for the Landing Page instead.
  • In Step 4 of the Form wizard (Completion Actions), add the below JavaScript to the 'Thank You Code' tab. Notice that you'll need to replace {form handler endpoint URL} with the actual endpoint URL for the form handler you created earlier in this process. If you change fields or add any additional fields to the form, you'll need to add them to the JavaScript as well.
  • In the example below, the {url} in the variable tag serves to URL encode the content. For more information about how this works, see this article.
  • If you'd like for prospects to be able to submit the form more than once, toggle 'Always display form after submission' on. This will mean that prospects can go back and submit the form again shortly after they've submitted it a first time.
  • Don't choose 'Redirect the prospect instead of showing the form's Thank You Content' - the Thank You Content will need to load in order for this to function properly.
  • Add any completion actions you may want to fire on the prospect submitting the Form, then save the Form. That should complete the Referral Form Setup, and anyone submitting the Form should also be able to submit information (email address, first name, last name) for a referral.

Notes

  • Only the most recent referee's data will be shown on the referrer's prospect record.
  • Same goes for the referee's prospect record - if more than one person refers that prospect, only the most recent referrer will be shown on the referee's prospect record.

Need more? Start a conversation with other Pardot users in our Success Community