Pardot Knowledge Base

Redirecting Your Form Automatically After Displaying Thank You Content

Last Updated: Oct 29, 2015
Woah there, partner! This is an advanced topic that involves custom script. Troubleshooting custom script is outside of Pardot Support’s scope, so proceed with caution.
You can display your form's Thank You Content for a few seconds (to confirm a prospect's successful form submission), and then have your form redirect automatically. Adjust the following JavaScript sample and paste in your form's Thank You Code tab.


  1. Navigate to Marketing > Forms.
  2. Either edit an existing form or create a new form.
  3. During Step 4 (Completion Actions) of the Form Wizard, click on the Thank You Code tab.
  4. Copy and paste the following code in the text area field:
  5. If editing an existing form, click Finish to save. If creating a new form, click Next to go to the confirmation page and then click Finish to save.
Just update the example url to the full url you wish to redirect to, and update 5 to the number of seconds you wish to delay before the download window appears.

When your Pardot form is in an iframe

When your Pardot form exists in an iframe on your site, the redirect location in the above sample will load within the iframe (not ideal). To have the redirect location happen outside of the iframe, use this code sample instead:

Usage Notes

  • In order to use this JavaScript, you must disable any redirect locations -- both at the form level or at the landing page level
  • You may want to consider updating your Thank You Content to display a message notifying prospects that their form submission was successful and include a hyperlink that prospects can click to return to your intended redirect location if JavaScript is not enabled on their browser:
Thank you for completing this form! You will be redirected back to the home page in 5 seconds. If not, click here!