Embed Tracking Code & Forms and Adjust Page ValuesThe Pardot WordPress Plugin allows you to easily add tracking code and forms to your WordPress.org 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
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
Integrating Pardot with CommentsIf 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.
- 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. http://www.yoursite.com/blog) 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.
- Once the form handler has been created, click on 'View Form Handler Code" to grab the code in the quotes and copy it.
- To integrate the Form Handler with WordPress, you'll need to edit your
comments.phpfile (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
- Create the Third-Party Site Search in Pardot.
- 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.
- Replace the value inside the 'action' attribute (usually
<?php echo home_url( '/' ); ?>with the action attribute value from your site search created in Pardot.
- Save and test. Your site search should be sending the query to Pardot and to your results page.