GA is not defined
-
Hi there
I have created a few events like this:
$(".mypop").on("click", function(e){ e.preventDefault(); ga('send', 'event', 'Popup', 'click', 'PopupReservation', '1'); console.log('popup'); });
After update I get: ga is not defined
I added manually the snippet:
(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', 'G-XXXXXXXXX', 'auto') ; ga('send', 'pageview');
Now it works because ga is defined but I think it is not correct
Some idea about what I’m doing wrong?
Thanks in advance!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘GA is not defined’ is closed to new replies.