KDP
KDP

Reputation: 634

Event tracking in Contact Form 7

I have a WordPress website that uses Contact Form 7 and MonsterInsights for Google Analytics tracking. I want to track a contact form submission in Google Analytics as an event using the Universal code. I believe that I have correctly set up the event tracking code based on a review of the following sites:

https://www.kathirvel.com/universal-analytics-track-wordpress-contact-form-7-submission/ http://contactform7.com/tracking-form-submissions-with-google-analytics/

My code in my Additional Settings for the plugin reads:

on_sent_ok: "__gaTracker('send', 'event', 'Contact Form', 'Submit');"

Note that MonsterInsights uses __gaTracker. When I use the Chrome Tag Assistant to inspect what happens when I submit a form, it appears that the event is correctly tracked:

https://www.google-analytics.com/collect?v=1&_v=j47&a=1517116654&t=event&_s=2&dl=http://www.EXAMPLE.com/contact/&ul=en-us&de=UTF-8&dt=Contact Us&sd=24-bit&sr=1366x768&vp=1349x662&je=0&fl=23.0 r0&ec=Contact Form&ea=Submit&_u=SACAAUABK~&jid=&cid=1111924964.1481473656&tid=UA-CODE-1&z=1891409473
 Hostname   www.google-analytics.com
Protocol    https
Path    /collect
Hash    
 v  1
_v  j47
a   1517116654
t   event
_s  2
dl  http://www.EXAMPLE.com/contact/
ul  en-us
de  UTF-8
dt  Contact Us
sd  24-bit
sr  1366x768
vp  1349x662
je  0
fl  23.0 r0
ec  Contact Form
ea  Submit
_u  SACAAUABK~
jid 
cid 1111924964.1481473656
tid UA-CODE-1
z   1891409473

However, Google Analytics is not showing any events either under Real Time or Behavior.

I have reviewed the following but not found a solution: Tracking in Universal Analytics - Contact form 7 JavaScript in Contact Form 7 Tracking in Universal Analytics - Contact form 7

Thanks in advance for your help.

Upvotes: 0

Views: 2165

Answers (2)

user9016044
user9016044

Reputation: 11

You might want to try the Contact Form 7 Google Analytics Intelligence plugin, https://wordpress.org/plugins/cf7-intelligence. It automates both submission tracking and goal creation without any coding.

Upvotes: 0

Klaudio
Klaudio

Reputation: 21

I struggled with this for a couple of hours, same issue as you have.

Finally what worked for me was simple.

You have to match GA 'Category' and CF7 'Title'.

Screenshot: https://digitalfactory.gr/wp-content/uploads/2017/04/contact_form7_ga.png

Upvotes: 2

Related Questions