0

I'm using Angulartics to implement events and tracking on my site.

See: https://github.com/luisfarzati/angulartics

We're currently injecting the analytics tracking code with GTM. If we don't inject the snippet, there's no traffic visible in Analytics.

See snippet:

<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-XXXXXXXXX', 'auto');
</script>

The events are sent and everything seems to work in GTM. We don't need to use ga('create', 'UA-XXXXXXXXX', 'auto') in the injected code because the UA ID is already set in GTM, so there is some magic Google is doing with linking up GTM with analytics.

Basically, without (//www.google-analytics.com/)analytics.js loaded, we see no traffic.

I thought this would work, but clearly it doesn't.

Can anyone help me out with this?

Thanks

Philippe Sawicki
  • 852
  • 14
  • 22
  • Did you check the [Angulartics documentation about Google Tag Manager](https://github.com/luisfarzati/angulartics#for-google-tag-manager) to validate that your setup is compatible with what the library expects? – Philippe Sawicki May 01 '15 at 16:38
  • Are you able to share your site to help with troubleshooting? – nyuen May 01 '15 at 16:45
  • @PhilippeSawicki Yes, I've double checked everything, followed all the instructions. Sadly, I cannot share my site. –  May 04 '15 at 08:51

0 Answers0