Tracking Form Conversions in Google Analytics Using Contact Form 7

Today we’re talking about how to track successful form submissions as Events and Goals in Google Analytics. Tracking form conversions in Google Analytics enables you to calculate the performance of your conversion pages and optimize accordingly. For this example, we’ll be using a free trial form that we made using the Contact Form 7 WordPress plugin.

At a high level, the process looks like this:

  1. Create the Event in CF7 in WP
  2. Validate the Event in GA’s Real-Time Reporting
  3. Create the Goal in Google Analytics
  4. Validate the Goal in GA’s Real-Time Reporting
  5. Calculate Conversion Rate
  6. Conclusion

Create the Event in CF7

The first step is to create the Event. To do this, we’ll go to:

WordPress Admin>Contact Form 7>Free trial form>Additional Settings

Additional Messages in CF7

We want to track in GA every time our free trial form is submitted. To do this, enter the following line of code in the text box in the Additional Settings tab of CF7 and click Save:

on_sent_ok: "__gaTracker('send', 'event', 'free trial', 'submit', 'success');"
OR
on_sent_ok: "ga('send', 'event', 'free trial', 'submit', 'success');"

Event tracking code in CF7

Read more about Events in Google Analytics.

Validate the Event in GA

In Google Analytics, go to Unfiltered View>Reporting>Real-Time>Events>Events. In a separate tab, go to your free trial form page and submit a form to test our Event. Go back to your Google Analytics tab—you should see a value of “1” for “freeTrial.”

Validate Event in Google Analytics

If your Event didn’t come through in GA, try one of these troubleshooting tips:

  • Be patient—it can take a minute or two
  • Refresh the page
  • Make sure you’re not in a View with filters that exclude your IP address
  • Double-check your code in CF7
  • Save the code in CF7>Additional Message
  • Create the Goal in Google Analytics

Configure the Goal in GA

In Google Analytics, make sure you’re in the same View (I’m using my Testing View) and navigate to Admin>Views>Goals>+NEW GOAL. Enter the following settings when prompted:

  • Goal setup => Custom
  • Goal description =>
    • Namefree trial
    • Goal typeEvent
  • Goal details =>
    • Event conditions
      • Category: free trial
      • Action: submit
      • Label: success
    • Save
Configure Goal in Google Analytics

Validate the Goal in GA

Repeat the same process that we followed earlier to validate our Event with one exception—under Real-Time Reporting, click Conversions (instead of Events). Open a new tab and once again navigate to your free trial form page to test our Goal. Submit another test free trial form and return to your Google Analytics tab to validate your Goal configuration.

Validate Goals in Google Analytics

If the Goal doesn’t come through, double check the Event conditions that you entered when creating the Goal. You want to compare the values in the Category, Action and Label fields with the last three values of your Event code in CF7—they should be identical.

If for example, you have “free trial” in your Event snippet, but “freeTrial” in the Category field of your Goal in GA, your Goal won’t fire because its values differ from the Event values. In other words, your Event values must be identical to your Goal’s Event conditions in Google Analytics.

Create the Goal in Master View

If you’ve been following along with me, you created your Goal in your Testing View in Google Analytics. Goals are unique to a View in GA—if you create a Goal in a Test View, you also have to create them in your Master View. You may only have one View for your Google Analytics account, and that’s fine, but I’d encourage you to create at least one additional “Test” View for these kinds of exercises.

Why? Because Event and Goal tracking doesn’t always work right away. Unless you’re an experienced developer, you’ll have to tinker with some of your code in either WordPress, Google Analytics or both before you’ve validated your Events and Goals.

The only thing to be careful with in using Test Views is that once you’ve validated your Event and then your Goal, it’s natural to be excited that you’ve got everything working which makes it easy to forget that you need to recreate your Goal(s) in your other Views. Otherwise, you’ll return a week later to your Master/Filtered View and see zero Events/Goal Conversions.

Your first reaction will be one of bewilderment…”I know I’ve had at least two forms come through? Why don’t I see them in Google Analytics?” Sooner or later you’ll remember that you only created your Goal in your Test View…

Calculate Conversion Rate

How is our free trial form page performing? With Event and Goal Conversions configured, it’s simple to calculate. Find the number of visits to the free trial form page and divide it by the number of conversions of our free trial Goal.
Conversion Rate = [# of conversions ÷ # of visits to free trial page]
The value in tracking conversion rate lies in its trend. That is, are you converting at a higher rate today than you were last month, last quarter, and last year? In the beginning weeks and months, you’ll have low conversion rates…or maybe they’ll be high. Honestly, it matters only how they convert over time. My point is that your starting conversion rates only matter in the context of comparing them to your form’s future performance rates.

Conclusion

Tracking form submissions in Google Analytics provides clear insight into how well your forms are performing. Instant access to form performance metrics enables you to optimize your lead pages and forms for maximum conversion rate. With Conversion Tracking—Events and Goals—implemented and configured in GA, you have instant access not only to your current conversion rates but also your historical rates enabling you to measure how your optimizations have impacted conversion rates over time.

ga('create', 'UA-XXXXX-Y', 'auto');
ga('send', 'pageview');
2 replies
  1. Bev
    Bev says:

    I’ve used both codes and although I can get it to show up in Real Time Conversions, it doesn’t show up in Real Time Events or in Conversion Goals. I do not use any Yoast or other Analytics Plugins. I have tried setting up tags and triggers in Tag Manager as well as have the Analytics Universal JS code installed. I’ve tried over a dozen different ways from as many articles and I still cannot get it to work! I even made sure to double check the quotes from copy and pasting just in case, everything seems to straight forward, but it just won’t work. What might I be doing wrong?

    Reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.