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’);”
becomes
on_sent_ok: “ga(‘send’, ‘event’, ‘category’, ‘action’, ‘label’);”
In my test, the event recorded immediately. Works like a charm. You’re welcome, internet.
Thanks so much – appreciate the post!
– internet.
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.
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?