Google Analytics Tracking on Contact Form 7
-
Hi,
I am struggling to make goal tracking working. I try to adapt the following article’s instructions on my website but still no success.
https://contactform7.com/tracking-form-submissions-with-google-analytics/I need to use this way of tracking, because Contact Form 7’s redirecting to a ‘Thank You’ page after form submission become unreliable recently, and I could not solve that problem either. I use Bridge Theme.
What I try to do just now:
1. Hardcoded tracking code on site as per below just before </head>
<script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-XXXXXXXX-X', 'auto'); ga('send', 'pageview'); </script>
2. On my contact form, at the additional settings area I use the following:
on_sent_ok: "ga('send', 'event', 'Contact Page Form', 'submit');"
where ‘Contact Page Form’ is the name of the form3. I set a new goal on Google Analytics, as per below:
Goal description – type: event
Goal details – action equal to submitThe other issue, I experience is, that the green success message stopped showing after form completion.
Any help is much appreciated. Thank you.
- The topic ‘Google Analytics Tracking on Contact Form 7’ is closed to new replies.