Jump to content

Google Analytics issue (can't find variable ga)


Zalayeta

Recommended Posts

Hi,

 

Somehow GA was not working anymore on my website. I tried to uninstall GA module and install it again but I still got the "can't find variable ga" error in the console.

 

So I went to GA website and copy paste the code they provide to modules/ganalytics/views/js/GoogleAnalyticActionLib.js

(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');

Now it works but I'm pretty sure it's not the right fix, does anyone knows what happens here and how to properly fix it?

 

Regards

 

Edit: actually I don't get the error anymore but I can't find any reports in GA either so it's not working properly

Edited by Zalayeta (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...