WordPress: Tracking “Contact Form 7” Conversions In Google Analytics
Sep 2012 09

Searching For A WordPress Contact Form Plugin?

There are countless WordPress contact form plugins available on the internet.
A favorite web developing/designing resource of mine, Six Revisions, showcased 20 of the numerous WordPress contact form plugins.

My search for a contact form ended with the Contact Form 7 (CF7) WordPress plugin.
Like many other plugins, CF7 was easy to set up. Not to mention the ease of integration with CAPTCHA and anti-spam plugins such as Really Simple CAPTCHA and Akismet.


Tracking Conversions Via Contact Form 7

The tradition conversion tracking mechanism will see users brought to a “Thank You” page after any form submissions. In the case of CF7, instead of a “Thank You” page, a “Thank You” message would be display on the same page after the user submits the enquiry. Therefore, conversions through CF7 would be tracked slightly differently.

Conversions generated via CF7 can be tracked in 2 manners:

1. Virtual Page View (VPV) Tracking.
2. Event Tracking.


Step By Step Guide To Tracking CF7 Conversions

Step 1 – Log into WordPress and go to the CF7 menu.

Step 2 – Look for Additional Settings

Contact Form 7 - Additional Settings

Enter either the following “on_sent_ok” javascript action hook if you want to track by VPV:


on_sent_ok: "_gaq.push(['_trackPageview', '/thankyou.htm']);"

Do note that the path do not necessary need to point to a physical file on the server. What the command mean is simply, when there is a submission via CF7, the pageview will be tracked and attributed to “thankyou.htm”.  The stated page is just a reference to GA and not a command to direct the user to “thankyou.htm” after a submission.


If you prefer to track by events instead, you can use the below “on_sent_ok” javascript action hook.


on_sent_ok: "_gaq.push(['_trackEvent', 'Form', 'Form-Submission']);"


Step 3 – Next log into GA, go to admin and set up your goals.

Google Analytics - Goals


Step 4 – Set up either a goal to track URL Destination (for VPV):

Google Analytics Goals By Virtual Page View


Or a goal to track events (for Event Tracking).


Step 5 – Assign a conversion value to your goals. Always try to assign a value to your goals, especially so if these are revenue generating goals.

Step 6 – Save your goals! Well done! You can now tracked all conversions via CF7!


Note: The advantage of  a “URL Destination” goal compared to an “Event” goal is that you can specify the goal funnels. In an “Event” goal, you can’t.


  1. Ken says:

    Thanks a bunch. More than I needed – now I have 2 great options 😉

  2. Shatul says:

    thanks buddy .. 🙂

  3. Kim says:

    The green thank you box does not work afterwards. Why not?

  4. John Rand says:


    I’m not seeing anything in Google conversions. Don’t I need to add an account somewhere?



  5. Helper says:

    If it is not working for you, maybe is because you are using the new Google Analytics …
    The new code for events is a bit different… check Google Analytics help “ga.js”

Leave a Comment