How To Use UTM Parameters to Capture Lead Source in Pardot


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.


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


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.


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

Related Posts

  • 11/12/2018
    Beautiful Pardot Forms: Styling Checkboxes and Radio Buttons

    Your Pardot forms don’t have to be boring. With a little extra CSS you can create beautiful Pardot forms with customized checkboxes and radio buttons. In this tutorial, I’ll show you how you can style checkboxes and radio buttons within Pardot forms with minimal coding

  • 24/10/2018
    How to Create a Net Promoter Score Survey in Pardot

    Learn how to build a net promoter score (NPS) survey directly in Pardot. I will show you how to create an NPS survey that asks the recipient to give you a score from 1 – 10 using an in-email rating that directs them to a Pardot landing page to collect more information.

  • 17/10/2018
    How to Implement MQL Tracking in Pardot and Salesforce

    You might already be tracking MQLs in Salesforce or in Pardot, but are you tracking all the information you need for enhanced reporting? I’ll walk you through the 3 steps you need to take for complete MQL tracking that can be used within reports and dashboard in Salesforce.

21 comment(s)
  • Brijendra Singh

    18/09/2018 at 10:42 am

    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!

    • Jenna Molby
      to Brijendra Singh

      18/09/2018 at 12:55 pm

      No, I haven't come across a way to do that in Pardot.

    • Rhonda Hernandez
      to Jenna Molby

      15/11/2018 at 6:40 am

      Hey Jenna, your code works wonderfully and pulls the info into the prospects record thank you so much for your detailed instructions.. However I am having trouble with the encoding of the UTM link that is attached to a button in my html email. What special characters do I have to change out to get the link to correctly update the "Click to open ratio in my email stats?

    • Jenna Molby
      to Rhonda Hernandez

      15/11/2018 at 8:43 am

      Hi Rhonda, So happy it worked for you. Here's a link to some detailed documentation on how to encode special characters within Pardot email links: Cheers, Jenna

  • Keenan

    04/09/2018 at 5:37 pm

    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(; 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

      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

    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

      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

    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

      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

    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

      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

      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.


Most Commented
Popular Posts