Contact Form 7 & Event Tracking with Universal Analytics

//Contact Form 7 & Event Tracking with Universal Analytics

Contact Form 7 & Event Tracking with Universal Analytics

The javascript hook that Contact Form 7 uses to send an event to Google Analytics has changed with the implementation of Universal Analytics:

on_sent_ok: “ga([‘_trackEvent’, ‘category’, ‘action’, ‘label’);”


on_sent_ok: “ga(‘send’, ‘event’, ‘category’, ‘action’, ‘label’);”

In my test, the event recorded immediately. Works like a charm. You’re welcome, internet.

By | 2015-05-09T19:32:48+00:00 June 5th, 2013|Traffic/Analytics|3 Comments

About the Author:


  1. Michael Chudy May 17, 2014 at 5:41 am - Reply

    Thanks so much – appreciate the post!
    – internet.

  2. Neeshu July 31, 2014 at 1:02 pm - Reply

    Hi Matt I have implemented this code in the extra settings provided under the form, and filled the data but it does not work for me what could be the problem, have I entered the action, label wrong in the analytics or I am placing the code else where.

    • Matt Swanner August 5, 2014 at 9:14 pm - Reply

      Neeshu – You shouldn’t have to enter anything in analytics to track events. Simply setting up the code will push the event info, and you will be able to see the reports if you log in to Google Analytics and navigate to Behavior >> Events.

      It sounds like what you’re trying to do is create a Goal, correct?

Leave A Comment