Pardot Knowledge Base

Passing URL Parameters from Browser to iframe

Last Updated: Oct 05, 2016 | Print this Article
 
Whoa there, partner! This is an advanced topic and requires JavaScript. Troubleshooting custom script is outside of Pardot Support's scope, so proceed with caution.

When you place a Pardot form on a webpage using an iframe, the parent page's URL parameters are not automatically passed to the iframe. This can cause issues with Google Analytics and first touch reporting. Good news -- there is a relatively easy fix for this that uses just a little bit of JavaScript. This method makes an iframe load with the same parameters of the parent page. For example, you could use this script to capture UTM parameters or pre-fill iframed forms.

Notes

  • Place the script where you want the form to appear.
  • If you want to include multiple iframed forms on the page, place the scripts where you want the forms to appear, and change the form URL.

Instructions

Insert the following code on your webpage. Be sure to replace both instances of PARDOT_FORM_URL with your form's URL.

Not what you're looking for? Check out these other articles:
Can I pass hidden fields to Pardot forms?
Populate Hidden Field on Form with Name of Webpage
Advanced Form Topics 
Google Analytics Connector

Need more? Start a conversation with other Pardot users in our Success Community