Configure Contact Form 7 for Google Analytics Conversion Tracking

I wrote in a previous blog post about all the amazing insights you gain from running Google Analytics on your website, but when it comes down to it, Google Analytics helps you to assess whether visitors are doing what you want them to or not.  For example, the goal of an e-commerce site is to compel visitors to make a purchase from an online store.  The goal of a B2B website may be to encourage potential customers to download a “white paper” about the supplier’s newest product line.

In order for Google Analytics to provide real business intelligence on your website’s performance, you first have to configure Analytics to recognize when a visit to your website results in the completion one or more of your sales or marketing goals (such as a store purchase, white paper download, etc).  In this post I outline exactly how to configure Contact Form 7 and Google Analytics to track and identify form submissions as goals within Google Analytics.  If after the slideshow you’d like more information about what Google Analytics can tell you about your website’s performance, visit our Website Optimization page.

Note: I presume anyone following these instructions already has both Contact Form 7 and Google Analytics installed and functioning properly.  If you need help getting Google Analytics setup feel free to contact us.

Contact Form 7 Additional Settings
Contact Form 7 Successful Submission
Virtual Pageviews as a Result of Form Submission
Google Analytics Goal Configuration
Google Analytics Goal Configuration
Goal Completion Reporting - Google Analytics

1. Determine the naming convention for your form submissions.

The contact form submissions will be tracked as virtual page views, so they will appear anywhere in Google Analytics that "real" page views do.  I suggest you provide each of your contact forms with a unique, easily identifiable label so you can filter and spot your form submissions in various in Google Analytics reports.  In this example, I decided to use:

/GA_Virtual/contact_form_name

2. Add the Google Analytics tracking code to the "Additional Settings" field of each of your contact forms.

Use the following code snippet, substituting the text in red for the event tracking syntax you chose above.  When you're done it should look like the image above.

on_sent_ok: "_gaq.push(['_trackPageview', '/GA_Virtual/generic_contact/']);"

3. Test each contact form you configured in Part 1.

Complete a test submission to each form.  Make sure you see the green confirmation box after each submission!

4. Find your form submissions in Google Analytics.

Go to "Google Analytics -> Content -> Site Content -> All Pages" and find the names of the form submissions you decided on in Step 1. Keep in mind that by default Google Analytics excludes data from the current day so you will probably have to adjust the date range of your report if you're completing this project in one day. If your date range is correct and you still don't see the virtual pageviews wait a few hours and look again.

5. Navigate to the "Goals" section of the Analytics dashboard.

Click "Admin" in the top-right corner of the Google Analytics dashboard, then click on the "Goals" tab just under your Profile name and Property ID.

6. Configure a new goal in Google Analytics for each contact form you're tracking.

Give your goal a meaningful name then select "URL Destination." In the field that appears enter one of the virtual pages you just verified in the previous step. Make sure you select "Head Match" and click "Save." Repeat this for each contact form you want to track.

7. Test and validate Goal Completion reporting.

Go back to your contact forms and complete one additional test submission for each form you're tracking. Wait a day or two then go into "Google Analytics -> Conversions -> Goals -> Overview" and you should see a report similar to the above that tallies your contact form submissions. If you see "spikes" in the report, congratulations - you're done!

Contact Form 7 Additional Settings thumbnail
Contact Form 7 Successful Submission thumbnail
Virtual Pageviews as a Result of Form Submission thumbnail
Google Analytics Goal Configuration thumbnail
Google Analytics Goal Configuration thumbnail
Goal Completion Reporting - Google Analytics thumbnail

2 comments

  1. Thank you for this really detailed guide! For a newbie, your step-by-step approach really helped as I just didn’t have a clue where to start looking for certain things, even if they might seen obvious to others.

Leave a Reply