angularytics icon indicating copy to clipboard operation
angularytics copied to clipboard

Error: ga is not deined

Open Paolo1991 opened this issue 8 years ago • 5 comments

I installed angularytics and follow the doc, but when i run i meet error: ReferenceError: ga is not defined

Paolo1991 avatar Mar 09 '16 10:03 Paolo1991

Same problem here

privetr avatar Mar 11 '16 08:03 privetr

@privetr you still need add google analytics script. You add this code before the angularytics define: <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', 'YOUR ANALYTICS KEY', 'auto'); ga('send', 'pageview'); </script>

Paolo1991 avatar Mar 11 '16 09:03 Paolo1991

Maybe you may add it in README or in any documentation page. Thanks :)

metal3d avatar Apr 13 '16 09:04 metal3d

@vanthanh9176 the Google analytics script should be added within the index.html, correct?

zcoon avatar May 25 '16 16:05 zcoon

Yes, Google analytics script have to add within the index.html

Paolo1991 avatar May 31 '16 00:05 Paolo1991