Pardot Form Tracking

Modified on Fri, 21 Feb, 2020 at 2:38 PM

Since Pardot forms are rendered in an iframe, it is not possible to listen for events that occur in an iframe. Work around is to add some custom code in the form that lets the website know that the when lead form was successfully submitted.


In your Salesforce Pardot form builder,  navigate to Look and Feel > Above Code, enable the source mode. Add the below code.

<script type="text/javascript">
pardot.$(document).ready(function($) {
    $("#pardot-form").bind('submit', function(e) {
        try {
            parent.postMessage('formSubmission', '*');
        } catch (e) {
            window.console && window.console.log(e);
        }
    });
});
</script>


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article