Zero Conf Mail – Google Analytics – Goal Setting

I use the Zero Conf Mail contact form plugin for WordPress on this website because it’s simple and gets the job done without requiring too much configuring. However, as-written it does not allow for goal tracking in Google Analytics. Sure you can track when someone lands on the page, but you can’t set a goal for when someone actually submits the form. Anyone familiar with online marketing knows that testing, tracking results and testing again are important components in making your website convert better, either for lead-generation (e.g. having someone fill out the contact form), or for sales.

I wrote the below hack to resolve this issue with Zero Conf. It is important to follow it exactly. It basically adds tracking to the thank-you confirmation page that pops up after someone submits the form, which can be tracked as a goal in Google Analytics. (Side note: I submitted this solution to the developer’s website but the formatting got all messed up somehow, so I’m posting it here)

  1. Install the Zero Conf plugin, configure and test it to make sure everything works.
  2. Create a “Page” on your site called /zconf-thanks/ with your thank-you message on it. Be sure to check off the boxes for robots noindex, nofollow, noarchive (just search the page for “robot” when you’re editing in wp-admin). We don’t want search engines to pick up this page accidentally and skew your goal tracking data.
  3. Under plugins on the lower-left navigation bar in the WordPress admin panel, scroll to Zero Conf Mail and click the Edit link.
  4. Click  the link zero-conf-mail/inc/page.php to edit that document. Be sure that it is writable on your server first so that you can save these changes. You can either make it writable using an FTP program, or chmod 777 page.php in Linux. Be sure to set the permissions back to 755 or similar to maintain the security of your website.
  5. Replace code as per below:

Replace this block of code:

if ( $success ) {
$return .= ‘<div>’;
$return .= $option[‘config’][‘messages’][‘success’];
$return .= ‘</div>’;
}

With this new block of code:

if ( $success ) {
$return .= ‘<div>’;
$return .= $option[‘config’][‘messages’][‘success’];
$return .= ‘</div>’;
/*** thank-you-page-redirect by ConsorteMarketing.com 6-1-2011 ***/
echo “<script>window.location.href=’/zconf-thanks/’;</script>”;
/**** thank-you-page-redirect by ConsorteMarketing.com 6-1-2011 ***/
}

You may then set your goals in Google Analytics. You may prefer to set your goals up differently, but below is a visualization to get you started. You can just copy the settings and it should work.

Zero Conf Mail Goal Settings

Zero Conf Mail Goal Settings

Your goal funnel in Google Analytics should then look something like this:

Zero Conf Goal Funnel

Zero Conf Goal Funnel

Need more help? Get professional WordPress training in NJ and NYC

  • By Dennis Consorte
  • Published on June 1st, 2011
  • Posted in Web Design. Tags: .