Tracking event not working with Google Analytics
-
I’ve just updated wordpress and all the plugins a couple of days ago.
The event tracking worked fine with on_sent_ok.
But I updated the Google Analytics Codes and the event tracking stopped working.
This is the code I added above the </head>
<!– Google Analytics –>
<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’,’https://www.google-analytics.com/analytics.js’,’ga’);ga(‘create’, ‘UA-35712443-1’, ‘auto’);
ga(‘send’, ‘pageview’);
</script>
<!– End Google Analytics –>
<script>
document.addEventListener( ‘wpcf7mailsent’, function( event ) {
ga(‘send’, ‘event’, ‘Contact Form’, ‘submit’);
}, false );
</script>In The goal of google analytics I added the following:
Goal type: Cuystom
Category equal to: Form
Action equal to: SubmissionBut I still don’t see events that I use to see with the old code.
The page I need help with: [log in to see the link]
- The topic ‘Tracking event not working with Google Analytics’ is closed to new replies.