Tracking UTMs from Pardot into Salesforce campaigns

Jul 22, 2021


by | Jul 22, 2021 | Technology


For any marketing team, the ability to understand exactly where your leads came from is gold dust. While tracking UTMs in Pardot is possible with the Google Analytics connector, it will only capture first touch and only for new prospects.

But what about everyone else in your database who isn’t new?

Or how about multi-touch attribution tracking?

To achieve this we need to get creative with tracking UTMs, and how that data passes from Pardot into Salesforce.

I spoke at ParDreamin in October 2021 on how you can set up tracking UTMs from Pardot into Salesforce campaigns to achieve channel attribution. If you are an audio-visual learner you can watch here.


Firstly, let’s talk about UTMs


UTMs are parameters of data appended to the end of a URL, originally created to allow for tracking in Google Analytics.

Below is an example:

UTMs typically consist of:

  • Campaign
  • Medium
  • Source

You can also use:

  • Content
  • Term

A few tips when it comes to creating UTMs to add to your URL:


  1. Avoid spaces
    Google will add “20%” instead of spaces and it can interfere with tracking. Use hyphens, underscores or full-stops instead. For example, if you want to use the following parameter “great case study” for UTM Content, you need to add it to the URL as “great-case-study” or “greatcasestudy” – any way in which there is no space between the words. Otherwise your URL will look like this:

    Instead of this:

  2. Type everything out in lowercase
    This has more to do with the information being captured in Google Analytics correctly as it’s a case-sensitive platform.

Can’t I use Salesforce Campaigns to track attribution already?


It’s not uncommon for a business to set up Salesforce Campaigns where you have one Campaign per channel. Let’s take the example of a guide. Our initial goal is to get people to download the guide. To drive people to the download page we may employ a few different tactics such as Google ads, paid social ads, organic social, content and email.

In Salesforce, it can be tempting to set this up as a Parent Campaign for the webinar itself, with a few Child Campaigns underneath, each representing a different channel.

This is not “the wrong way” to set this up, but the con of having one Campaign per channel is that you would then need one Pardot Form per channel. This is because Pardot Form Completion Actions are not able to add prospects to different CRM Campaigns based on variables like UTM parameters. This results in marketers having to manage multiple forms for one Campaign, which is not ideal!

By tracking UTMs and passing them through to Salesforce Campaigns via fields on the Campaign Member object we can leverage them to see which marketing tactics is the one that converted them to download our content. This eliminates the need for all those Child Campaigns and leaving us with just one Parent Campaign. Clean and simple. What’s not to like?

To achieve this you need to do four things:

  1. Set up custom Salesforce fields on the Lead, Contact and Campaign Member objects
  2. Set up custom Prospect fields in Pardot for the UTM parameters
  3. Modify Pardot Forms to correctly capture the UTM values
  4. Create a Flow in Salesforce


Let’s go through each step


NOTE: For steps 1 and 4 you will have to liaise with your Salesforce Admin. Even if you have the ability to create fields and Flow in Salesforce, discuss with the appropriate teams what you plan to do, why and how, in case there are special considerations with your Salesforce org.


Step 1: Set up custom Salesforce fields on the Lead, Contact and Campaign Member objects

To get the UTM parameters into Salesforce we need to set up several fields across multiple objects.

First, on the Lead and Contact objects you will need two sets of UTM fields: visible and hidden. If you follow a naming convention similar to the image below that will help you easily identify the two different sets of fields:

NOTE: The “Last Touch” fields should be visible on the page layout and the “Copy” fields should be hidden.

Keep in mind that the “Last Touch” fields are the ones which will be mapped to Pardot, and are called “Last Touch” because these fields will change any time a Lead/Contact engages with a marketing campaign that contains UTMs.

If you are interested in also capturing “First Touch” – and not relying on the Google Analytics fields, then you would need to create another set of UTM fields and likely use another Flow in Salesforce to populate those fields correctly.

Last, we need to set up UTM fields on the Campaign Member object. You only need one set of fields here, they should be visible on the page layout, and there is no need to distinguish them as being “First/Last Touch”.

Step 2: Set up custom Prospect fields in Pardot for the UTM parameters


You need to create custom Prospect fields for all the UTM parameters you want to track. When creating them, ensure the Field ID value uses all lowercase (see picture below):

Step 3: Modify Pardot Forms to capture the UTM values


In Pardot there are three scenarios for how forms are used:

  1. Embedded form on website
  2. Form handlers
  3. Form on a Pardot Landing Page

With all of the above you have to add your new custom UTM fields as hidden fields. A key thing to remember is to not set the fields to be required or pre-filled.

If you plan to use a Pardot Form on a Pardot Landing Page, the good news is there is nothing else required to pass UTM values from the URL to the Pardot Form.

If you plan to use the other two methods – which most of us do – then a bit of Javascript is required to help pass the UTM values into the hidden fields.

The infamous Jenna Molby has a wonderful blog post where she explains how to do this and provides your with the Javascript. Because the process involves adding Javascript to your website, you may need to get your website admin involved who has the appropriate access and knowledge to add the script.

TOP TIP: before adding the script to every page where you have a Pardot Form/Form Handler, test with just one first to ensure it all works as expected. Based on how your website is built, you may require custom Javascript to make this work.


Step 4: Create a Flow in Salesforce


The last step of setting up a Flow in Salesforce is what brings this all together. I’ll be providing a top-level overview on how the Flow should work, along with a diagram, which if you work with your Salesforce Admin on they should be able to set this up.

A Flow in Salesforce is similar to an Automation Rule in Pardot, but much more powerful. We need to set certain criteria for the Flow to check on, and depending whether the result is true or false, we tell it what actions to take.

With our Flow, the first step is to have it check whether a new Campaign Member record has been created. When true, it then needs to check the corresponding Lead/Contact record and determine whether the “UTM Last Touch” fields are different to the “UTM Copy” (hidden) fields.

If it’s yes, this signifies that a change has occurred on the “UTM Last Touch” fields, therefore those values should be attributed to the newly created Campaign Member record. The Flow then needs to copy the “UTM Last Touch” field values to the UTM fields on the Campaign Member record.

After this, it then needs to copy the “UTM Last Touch” field values to the “UTM Copy” (hidden) fields on the Lead/Contact record.

See what’s happening here? The process starts with the “UTM Last Touch” and “UTM Copy” fields being different, but at the end they are the same. The “UTM Copy” fields are acting as a control, they are what tell the Flow whether new UTM values have been added to a Lead/Contact record or not.

In the event that the “UTM Last Touch” and “UTM Copy” fields are the same at that initial check of these fields, the Flow simply ends, and no information is copied anywhere. This would happen in a scenario where a user comes direct to your website and submits a form, and therefore there are no UTM parameters were in the URL to be passed into Pardot. If they are a net-new person, all our UTM fields would be blank, and if they were an existing Contact (with UTM values on their record), those UTM fields would be populated but all with the same value.

In either case, the “UTM Last Touch” and “UTM Copy” fields are the same (either blank or populated) which signifies that there were no new UTM parameters captured, and therefore the UTM fields on the Campaign Member record will remain blank.

A few considerations before you go running to your Salesforce Admin with all this information:

  1. The Salesforce Pro edition allows only 5 Flows to be active at the same time. If all are already in use you then need to work with stakeholders to see if one can be freed up or look into upgrading your Salesforce org.
  2. Avoid using Process Builder as Salesforce plans to retire these in the near future.
  3. You cannot use Pardot automations as they cannot populate Campaign Member fields.


Reporting on Campaigns using UTMs


Now that everything “behind the scenes” is set up and working, you can start to build reports in Salesforce that will show how your marketing tactics (aka channels) are performing against your campaigns.

The way to do this is to go into Reports and select Campaigns > Campaigns with Campaign Members.

If you want to analyse a specific campaign, add that to the filter criteria, or if you want to look at all your campaigns over a certain date range, select that instead.

Remember you can also filter by “Campaign Record Type” if you have these configured and there are certain campaign types you only want to report on.

Another filter which may be useful is “Member Status”, because here you can select the Member Statuses which you’ve aligned to represent a “responded” Campaign Member.

Once you have your filters in place, decide which columns you want to see. A good setup to start with is to include all your UTM fields from the Campaign Member record, and then under “Groups” add “Campaign Name” and “UTM Medium”.

The end result should look something like this:

I can now see for this particular campaign, of the Campaign Members who have a “responded” status, 53% of them came from paid social, 30% from Google and 17% from email.

This information not only tells me which channels performed best for this campaign, but also where I may want to place more budget for future, similar campaigns.

A similar report can also help to answer other questions such as:

  1. Which channels are driving people to my campaigns over the last month, quarter, year?
  2. Are there certain channels which resonate best with certain campaigns/campaign types?
  3. Which channels are influencing won opportunities in my campaigns?


Next steps


As mentioned earlier, before diving straight in with field creation you should discuss this approach with all the appropriate stakeholders in your business, not only to get their buy-in, but to firstly confirm that this is needed. Then work with your Salesforce Admin to check that you have a Flow available and plan out a timeline for doing all the above steps and configuration.

Need help?
As a Salesforce Partner we have a dedicated Marketing Automation team who have helped clients implement this solution, taking into account the bigger picture of how Pardot and marketing processes can best align to business objectives. If you would like to discuss whether you need additional support with Pardot, get in touch.

Further reading

Google’s new SGE & what it means for your SEO & PPC strategy

The future of marketing research