New
Are you ready for Agentforce? Take our assessment to find out today!
    • Expertise
          • Product

          • Sales Cloud
          • Service Cloud
          • Account Engagement
          • Marketing Cloud Next
          • Revenue Cloud
          • Agentforce
          • Data 360 (Data Cloud)
          • CRM Analytics
          • Tableau Next
          • Experience Cloud
          • Industry

          • Manufacturing
          • Healthcare
          • High Tech
          • Financial Services
          • Media & Entertainment
    • Solutions
      • Consulting
      • Implementation
      • Managed Services
      • Health Check
      • Training
    • About Nebula
      • We Are Nebula
      • Meet the Team
      • Join Our Team
    • Resources
    • Login
    • Get in Touch
Share:

Capture the webpage when using a Pardot form on multiple pages

by Nebula Consulting
23rd November 2021 • 7 min read
Nebula Consulting
Share:

If you’re using one Pardot form on multiple pages across your site (for example your website footer), the chances are that you’d like to know what page on your website your prospects have converted on. In this article, we’ll show you how to capture the webpage, with a couple of options for how to achieve this.

First things first, we’ll need to create a custom field to capture the data in Pardot (if you also want this data available in Salesforce, you’ll need to create the field in Salesforce and map it in Pardot):

Create Custom Field

Then we’ll need to add the field as a hidden field on our form:
Hidden field on form

Then we need to consider how we’re using the forms and choose one of the options below.

Option 1 – The same iframe code is on multiple pages on your website

This option is a low code solution for those instances where you’re inserting the same iframe code on multiple pages on your website – so the same form is appearing on multiple pages.

For this option you need to copy the html code Pardot provides and append the Pardot Form URL with a parameter that exactly matches the name of your custom field ID followed by whatever page the form is on:

iframe code

Pardot forms are clever enough to pull in parameters that match field IDs (this is why it’s important for your custom field ID to match exactly!). In the example above the hidden custom field we created and added to the form will be populated with “contact-us-page” once the form is submitted, this will then be stored in Pardot.

Don’t forget that you’ll need to update the value (everything after the ‘=’) on every page your form is used to match the page name.

Option 2 – Your form’s iframe code is automatically inserted on page templates in your CMS

What if you only insert your iframe code into a page template which is then automatically populated on multiple pages? A good example of this would be a contact form in the footer of every page on your website.

This is where we’ll need to get a bit crafty with code. We’re going to use Javascript to capture the page URL (or title), and then re-write the iframe embed code with a customer parameter and the captured data added as a value.

Here’s the code snippet:

First, there are a few key areas we’ll need to update:

        
        PARDOT_FORM_URL
    • Anywhere you see this in the code above we’ll need to enter our Pardot form URL. We can copy this from the usual embed code Pardot creates: HTML code in webpage
        
        
        CUSTOM_FIELD_ID
    • Remember the custom field we created in step one? We’ll need to enter the field ID here, exactly as it is in Pardot (yes; capitalisation matters).
        
        
        Height
  • Depending on the size of the form, we may need to adjust the height of the form. To do this we can change the number next to anywhere you see ‘height’ in the code. In the code above we’d need to change ‘1050’.

Let’s break this down

The first <noscript> part is a fallback option to ensure the form still loads even if the user has Javascript disabled. You will just need to update the PARDOT_FORM_URL and height parameters in this section.

The next <script> section is where the magic happens. Without going into each detail, we’re essentially creating the iframe code from scratch. We’re also pulling in the page URL into a custom parameter (which is the name of your custom field ID) that’s then appended to the end of the PARDOT_FORM_URL.

Let’s look at an example. Here’s the code we’d paste wherever we want our form to appear:

So we have a form url of: https://go.test.com/test/form
and a custom field ID of: Conversion_Page

And this is the embed code that will be generated on the page:

So with the above we can see that the form is on the http:‌//test.‌com/contact page. Pardot forms are smart enough to pull in parameters that match field IDs (this is why it’s important for your custom field ID to match exactly!). So the hidden Conversion_Page field on my form will be populated with http:‌//test.‌com/contact/ once the form is submitted. This will then be stored in Pardot.

Swapping page URL for page title

In the example above I’m pulling in the full page URL, but what if you’re only interested in the page title? Then you’ll need to make a simple tweak to one of the variables in the code: var title.

If we replace:

    
    
    var title = encodeURIComponent(document.location);

With:

    
    
    var title = encodeURIComponent(document.title);

Then we’ll see the page title pulling through instead:

Swapping page URL for page title

Capturing UTM Parameters

There’s one more thing… This code has been developed to capture any additional parameters from the page URL, such as UTM parameters, and pass them onto the iframe code – that way if you have hidden fields for your UTM parameters these should also automatically populate.

Considerations

Testing

First thing to do when implementing this is to test it. Make sure your form is at the very least pulling through to your webpage, then we can hop in to the developer tools to see if everything is pulling through as expected.

Right click the form > Inspect, then look for the iframe code, if it’s working as expected you should see your Pardot From URL appended with your custom field id and the page URL/title the form is on:
Testing

Next check that the hidden field is being populated with the right value, find your hidden custom field and click the disclosure triangle to see any nested elements, then look for value= It should have been populated with the page URL/Page title value=”contact us”. If not you’ll need to check that your custom field ID is exactly as it is in Pardot.

First touch vs. Last touch

One other thing to consider is if you want to capture the conversion page every time a prospect fills out the form (thus giving you the last page), or if you only wan’t to capture a prospects first conversion page. If you’re only interested in the first conversion page, then you’ll want to check the ‘Maintain the initial value upon subsequent form submissions’ box on the hidden field:
Capture the webpage

If it’s last touch you want to be tracking then remember to check the boxes to not pre-fill and to always show the field:
Capture the webpage

You can find Pardot’s help article on this solution here.

If you’d like to learn more about Pardot forms or get some further guidance, then get in touch.

Find related resources by topic

Marketing

You may also be interested in

Fix the Foundations: Success in the Agentic Era Marketing Edition
Blog
Marketing

Fix the Foundations: Success in the Agentic Era Marketing Edition

We hear the announcements and on repeat about how the Agentic Era is here to transform the B2B and B2C landscapes. These changes will enable…

4 min read Read Blog
Laying the Right Foundations
Success Story
Account Engagement Sales Cloud

Laying the Right Foundations

Complex processes and cautious stakeholders hindered Redwheel's CRM adoption. Nebula's Account Engagement and Salesforce audits mapped the journey, restoring confidence and delivering a strategic roadmap for a powerful, sales-enabled CRM.

May 27, 2025 Read Customer Story
How to Avoid Completion Action Limits in Account Engagement (Pardot) Using Engagement Studio
Blog
Marketing

How to Avoid Completion Action Limits in Account Engagement (Pardot) Using Engagement Studio

Conditional completion actions and completion actions, while powerful, can quickly consume the available limits on your forms and form handlers. If you’ve been creating and managing…

3 min read Read Blog
Aligning Marketing and Sales for a Global Insurer
Success Story
Account Engagement Sales Cloud

Aligning Marketing and Sales for a Global Insurer

Poor email deliverability and disconnected data misaligned Lockton's sales and marketing. Nebula's Salesforce and Account Engagement integration established governance, delivering a 97% delivery rate, 25 empowered users, and transparent insights.

Apr 30, 2025 Read Customer Story
Upgrade Your Form UX with Toggle Switches
Blog
Marketing

Upgrade Your Form UX with Toggle Switches

If you would like to modernise your forms, provide a slicker user experience, and match contemporary web design, follow our mini guide that helps you…

2 min read Read Blog
Creating a seamless membership experience
Success Story
Account Engagement Sales Cloud Service Cloud

Creating a seamless membership experience

Data silos and disparate systems hindered the World Travel and Tourism Council's membership experience. Nebula's Cvent integration, record cleansing and automated invoicing delivered rapid efficiency, unified data, and a 10-year partnership.

Jan 30, 2025 Read Customer Story
Account Engagement Landing Page Conversion Mastery
Blog
Marketing

Account Engagement Landing Page Conversion Mastery

Building pages that truly perform in Account Engagement isn't just about clicking buttons; it's about strategy, technical finesse, and empathy for the user. Here’s my…

5 min read Read Blog
Targeted Sales Enablement for Users
Success Story
Account Engagement CRM Analytics Sales Cloud

Targeted Sales Enablement for Users

Stale opportunities and missing data delayed Clarion Events' pipeline. Nebula's Einstein Next Best Action delivered intuitive guidance, surging stage moves by 132%, doubling activities, capturing crucial VAT details, and boosting CRM adoption.

Jan 3, 2025 Read Customer Story
5 Hidden Snags in Account Engagement
Blog
Marketing

5 Hidden Snags in Account Engagement

Managing Salesforce Account Engagement (Pardot) requires more than just marketing knowledge. Even in a well-established org, you can sometimes hit some invisible walls. Below are…

4 min read Read Blog
5 new Marketing Cloud Next features we’re excited to try
Blog
Marketing

5 new Marketing Cloud Next features we’re excited to try

The Spring ’26 release is here, and it’s a significant milestone for Marketing Cloud Next (also known as Agentforce Marketing). This release focuses on making…

4 min read Read Blog
Nebula

Our journey started in 2012 with a clear vision and core values. Nebula is dedicated to empowering our customers through fostering relationships founded on collaboration, flexibility, and trust.

  • We Are Nebula
  • Resources
  • Join Our Team
  • Terms and Conditions
  • Privacy Policy
The Space Aldgate,
Irongate House,
22-30 Dukes Place,
London EC3A 7LP
+44 207 112 8026
Get in Touch
Copyright © 2026 Nebula Consulting. All Rights Reserved.