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.

In part 1, I covered how to use UTM parameters to capture lead source when you are embedding a Pardot form on a Pardot landing page. In this post, I will cover how to implement the same method using an iFramed form on a web page.

Note: step 1 and step 2 are the same as the instructions outlined in part 1.

Step 1: Create new fields and add them to your forms

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

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

Step 2: 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.

Step 3: Embed your form on your web page

Use the standard iFrame code Pardot provides to embed your form on your webpage.

Step 4: Give your iFrame and ID and add the JavaScript

Since we will be adding some JavaScript to the web page in order to pass the parameters to the iFrame, we need to give the iFrame an ID. Here’s what my iFrame code looks like after adding the ID called “myiframe”.


Add the JavaScript to your web page that will pass the URL paramters from the parent page to the embedded Pardot iFrame form.


If you used a different ID for your iFrame, other than “myiframe”, you will need to update the ID within the JavaScript.

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 me a tweet @jennamolby, leave a comment below, or book a Peer Chat.

Author

I'm a Freelance Marketing Operations Consultant With 15 years of experience in Marketing Operations, I’ve worked with a wide range of tools including Salesforce, Marketing Cloud Account Engagement (Pardot), Marketo, and many other sales and marketing platforms. I help teams optimize their tech stacks, improve processes, and get accurate, actionable reporting. Whether it’s setting up your Marketing Automation Platform, building Salesforce reports, managing lead lifecycles, tracking attribution, or integrating your tech stack, I ensure everything is aligned to drive real results.

19 Comments

  1. JARED DAVIS Reply

    Jenna,
    I have a form thats on multiple pages and am trying to pass a value to a hidden field using the URL parameters. But when I try and the parameters to the URL on my Pardot landing page I am getting an error that i cant use “?” in my URL. Am I missing something?

    • Jenna Molby

      Hi Jared, That is strange. Is there only one “?” in your URL? Are you using any other special characters? Cheers, Jenna

    • Jenna Molby

      Hi Tommy, Yes, this is correct. This should populate the fields within Pardot. Cheers, Jenna

  2. Hi Jenna!

    Can you tell me how this would work for Form Handlers? I’ve been using this method on my Pardot forms, but now we’re transitioning to Form Handlers. Thank you!

    Abby

  3. hi jenna, great tips and we use them a lot. we also send the utm parameters to Salesforce (via contact to campaign member) and then we connect them to the opportunities that were generated via that campaign to have better channel reporting.

    But we notice that we can not always capture the utm parameters because of 2 reasons:
    1. visitors visit other pages of our website before submitting form and in that case the utm parameters are not showed in url anymore
    2. traffic sources were you can’t control the utm parameters (e.g. organic search).

    do you have an idea if there is solution for that ? is there a way top capture that source/medium data as well ?

    Keep up the good work!

    Rob

  4. Cole McIntyre Reply

    Hey Jenna! Pleasure to connect with you directly! I’m on the Pardot Specialist team over at Salesforce and UTMs are one of my favorite topics. I love sharing these articles with clients. Very well written and user-friendly. Quick thing I noticed that I figured you’d appreciate seeing – it looks like you use the same “add some code to your landing page templates” verbiage in this article that you use in part one here (https://jennamolby.com/how-to-use-utm-parameters-to-capture-lead-source-in-pardot/) even though this article seems to be focused more on iframed forms on the site as opposed to Pardot landing pages. Let me know if I’m missing something! But figured I’d pass along as a friendly observation – confused me at first glance since it isn’t speaking to how the code would be embedded on the website page in this case. Anyway, thanks for all your amazing content – you probably know this, but our team shares your articles with our clients constantly 🙂 So thanks for all that you do!

Write A Comment