Pardot Knowledge Base

Integrating Pardot with Sites

Last Updated: Apr 26, 2016 | Print this Article
WordPress is one of the most widely distributed and powerful free content management systems (CMS) and blogging platforms available today. In order to leverage this platform, Pardot has the ability to integrate with WordPress through a WordPress plugin (see WordPress Plugin for more information) as well as manual integration with Comments and Site Search (see below).

Note: The integration applies to, not Only will allow you to add javascript to your blog.

Embed Tracking Code & Forms and Adjust Page Values

The Pardot WordPress Plugin allows you to easily add tracking code and forms to your site.  See WordPress Plugin for more information on this integration. Once you have installed and activated the plugin, you can use Page Actions to adjust the point value of any page that will not utilize the default point value (+1 per page viewed). If you need to integrate Pardot without using the plugin, you'll need to hook the tracking code into your site using the wp_footer() function.

Use a plugin like Insert Headers and Footers if you're not familiar with this function. If you need different campaigns on different content inside your WordPress installation, you'll need to work with conditional tags before hooking into wp_footer().

Integrating Pardot with Comments

If you have ever wanted to track what comments your prospects are saying on your blog, this can also be tracked if your theme allows it. Currently, this is difficult to implement in many WordPress themes without editing the core files, which we advise against. We're working with WordPress Core to provide an option.

If your theme calls a custom form element that gives access to the form action URL, you can follow these instructions. Otherwise, hooking into comment actions may be necessary through custom development for now. Please back up your theme files before proceeding. You'll be making changes to your existing theme or creating a child theme.
  1. Start in Pardot and create a form handler based on the comments form you currently have on your blog. Most likely, you will have the fields: Name, Email, Website, Comments. Since Pardot likes for first name and last name to be separate, consider just tracking email and the comments.  See screenshot below: In this, you would want to make the success location the site of your blog (i.e. with /wp-comments-post.php. Also, you will want to make sure you enable forwarding to the success location, that way Pardot can forward the post to Wordpress. Lastly, map the fields as you would with a normal form handler.
  2. Once the form handler has been created, click on 'View Form Handler Code" to grab the code in the quotes and copy it.
  3. To integrate the Form Handler with WordPress, you'll need to edit your comments.php file (most likely). We recommend you not edit an existing theme, but create a child theme if at all possible—an exception would be themes custom-built that won't be updated by a third-party. In any case, you'll replace the form action with your Pardot Form Handler URL that you copied in the last step. We also recommend you edit your files over FTP using code editing software. Although WordPress offers an editor, saving flawed code can break your site.

Integrating Site Search with Pardot

  1. Create the Third-Party Site Search in Pardot.
  2. To integrate Pardot into your WordPress site search, you'll need to make a change in searchform.php. You'll want to create this file if your theme doesn't already have it, or create a child theme if your existing them does (custom-built themes may be an exception). If you need to create the file, put in one of the custom form codes supplied by WordPress. We recommend you edit your files over FTP using code editing software. Although WordPress offers an editor, saving flawed code can break your site.
  3. Replace the value inside the 'action' attribute (usually <?php echo home_url( '/' ); ?> with the action attribute value from your site search created in Pardot.
  4. Save and test. Your site search should be sending the query to Pardot and to your results page.

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