How To Use UTM Parameters to Capture Lead Source in Pardot

In:

You might already be using UTM parameters to track your marketing campaigns with Google Analytics, but are you capturing that information when a prospect is created in Pardot? Capturing this data is critical in order to assess the value of your marketing campaign and is a lead management best practice.

What are UTM Parameters?

UTM parameters are tags you add to a URL. Marketers use this to be able to track the traffic from a variety of sources such as email, social media, banner ads, etc. The tags can be sent back to Google Analytics and tracked which can be used to gauge the effectiveness of campaigns and identify the best ways to drive more visitors to your website.

hidden-fields-in-forms-3

Create New Fields

The first thing you need to do is create 2 new fields in Salesforce and in Pardot and map them. You don’t need to create a field for utm_source, we will use the standard source field in Pardot.

  1. utm_medium
  2. utm_campaign

hidden-fields-in-forms-2

Add The New Fields to Your Pardot Forms

Next, add the fields to your Pardot form. All 3 fields should be hidden and not marked as required.

Add Some Code to Your Landing Page Templates

This piece of code will parse the URL parameters and put the values into the hidden fields within your form. This code can be placed within your landing page template or within your form in the below form section.

Note: If you don’t use the field names outlined in this tutorial, you might need to update the JavaScript to include the correct field names.

Create URLs and Test

Now you’re ready to start creating URLs and testing your form. Use this handy URL builder to create your links and then fill out the form to see if the values go into Pardot.

Questions?

Send them to me via email, send me a tweet @jennamolby, or leave a comment

Related Posts

14 comment(s)
  • Brijendra Singh

    18/09/2018 at 10:42 am
    Reply

    Hi Jenna, Is there any way we can append the UTM parameters in the links that we use in emails? I wanted all my email links starting with "www" to have the UTM parameters automatically. This can be done in Responsys & in Eloqua. But couldn't find a way to do for emails in Pardot. Thanks!

  • Keenan

    04/09/2018 at 5:37 pm
    Reply

    Hi Jenna, thanks for all your content. I've followed your content for Marketo tips in the past and again now as I'm onboarding Pardot for my org. I'm having trouble getting your code to work. I've tried it both within my page and through the 'below form' section with the code input section. I modified the code to include utm_content and term, and renamed the fields according to my Pardot API field names. The custom fields are type = hidden, the sync behavior is to use Pardot's value, No matter where I've implemented the code, I haven't seen any values passed. If there is a lead with pre-existing data, the last touch fields are submitted as blank (and then subsequently switched back by the SFDC sync). If the lead has no pre-existing data, then nothing is registered. My code is below -- Any ideas why the values aren't being passed? Thank you again! // Parse the URL function getParameterByName(name) { name = name.replace(/[[]/, "\[").replace(/[]]/, "\]"); var regex = new RegExp("[\?&]" + name + "=([^&#]*)"), results = regex.exec(location.search); return results === null ? "" : decodeURIComponent(results[1].replace(/+/g, " ")); } // Give the URL parameters variable names var source = getParameterByName('utm_source'); var medium = getParameterByName('utm_medium'); var campaign = getParameterByName('utm_campaign'); var content = getParameterByName('utm_content'); var term = getParameterByName('utm_term'); // Put the variable names into the hidden fields in the form. selector should be "p.YOURFIELDNAME input" document.querySelector("p.Lead_Source_Name__Last_Touch_ input").value = source; document.querySelector("p.Lead_Source_Last_Touch input").value = medium; document.querySelector("p.Lead_Campaign__Last_Touch_ input").value = campaign; document.querySelector("p.Lead_Campaign_Content__Last_Touch_ input").value = content; document.querySelector("p.Lead_Campaign_Term__Last_Touch_ input").value = term;

    • Jenna Molby
      to Keenan

      05/09/2018 at 9:16 am
      Reply

      Hi Keenan, Your code looks good to me. Can you email the link to the landing page to [email protected]? Thanks, Jenna

  • Lou

    03/08/2018 at 1:45 pm
    Reply

    Hi Jenna, would it be possible to do this to the form handler as well? Thanks!

    • Jenna Molby
      to Lou

      03/08/2018 at 3:43 pm
      Reply

      Hi Lou, Yes, It's possible. You would need to add the hidden fields to your form handler and add the javascript to your page. You might need to make some adjustments to the javascript to match the selectors you define within your form handler code. Cheers, Jenna

  • Sean

    02/08/2018 at 11:48 am
    Reply

    Hi Jenna, If I add the code to the below form section in Pardot, how can i keep that text hidden on my form? When i click "view online" i can see the html below my form. Thanks!

    • Jenna Molby
      to Sean

      02/08/2018 at 1:16 pm
      Reply

      Hi Sean, Make sure you wrap the JavaScript in script tags. I've updated the example to include this. Cheers, Jenna

  • Andy

    26/07/2018 at 5:51 am
    Reply

    Do you also leverage the Google Analytics connector to pull in this information, or do it only through the hidden form fields?

    • Jenna Molby
      to Andy

      26/07/2018 at 12:58 pm
      Reply

      Hi Andy, you can use both! The Google Analytics connector only captures the UTMs once, so you could use that for the first touch and this method for the last touch. Cheers, Jenna

    • Dave
      to Jenna Molby

      30/08/2018 at 8:56 am
      Reply

      Hi Jenna. When you say that the GA connector only captures the UTMs once, when is that exactly? The first time they are written to the database? The create date?

Leave A Comment

Your email address will not be published. Required fields are marked *

About Me

Welcome to my blog, where I share, tips, tricks, thoughts and solutions that I learn in my daily life as a sales and marketing professional.

LEARN MORE

Categories
Most Commented
Popular Posts