Newer post available
Hi there, you are viewing an old post that is a bit outdated. Click here to view the post with the latest instructions.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.
- utm_medium
- 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.
Questions?
Send them to me via email, send me a tweet @jennamolby, or leave a comment
57 Comments
Hi there. I’m new to Pardot and trying to understand how this works with the other tracking elements in the platform.
In Automation Rules, I have the option to look for criteria “Prospect Google Analytics parameter” (campaign, source, content, medium are all available for me to choose from underneath the Prospect GA Parameter option) and then set a Pardot Campaign based on that parameter.
We already code every ad we place with utm parameters… so how is this different? Or is this only applicable to emails, since the utm parameters aren’t built in for Pardot emails?
Thanks for your help!
Hey Jenna! So thankful for this article! As a non-coder (for now!), this was extremely helpful! Do have a quick question, if we wanted to add “utm_content” as a field, in the script, would I be able to add a line similar to these?
var content = getParameterByName(‘utm_content’)
document.querySelector(“p.utm_content input”).value = content;
Hi Catherine, You’re welcome! Yes, you would be able to add that line to get “utm_content. Cheers, Jenna
Hi! I know you described that it’s not necessary to create custom utm_source field and we can use the default field, but in my case, it would be better to use the custom fields. However, when we did that, the source value is populated to the default field. Do you know if Pardot does that even if we use the custom field? Or this rather should work properly and we do something wrong?
thanks!
Hi Jenna, we’re using form handlers on our website. Can we use it there too?
Hi Abdul, Yes, you can use it for form handlers on your website.
Hi Jenna,
I’ve been working on implementing your script but I’ve run into a bit of a snag.
It seems to work fine when it’s on our go.pardot.com domain, but when I have it as an iframe embedded on our website it doesn’t seem to work.
Is there any way to get it to work from within an iframe or am I missing something?
Or would I be better off doing through a form handler?
Thanks,
Will
Hi William, Yes, that’s correct. This script will not work on pages with an iFrame form. I’m working on another post on how to do this, stay tuned! Cheers, Jenna
Hi William, Part 2 is now published here: https://jennamolby.com/how-to-use-utm-parameters-to-capture-lead-source-in-pardot-part-2/. In part 2 I cover how to pass URL parameters to an iFramed Pardot form. Cheers, Jenna