Question

Photo of Brad Kemp

0

Can't add Google Analytics Code

I've been trying to add analytics code to our External Site under CMS Configuration / Sites / Site Detail 

Under the Google Analytics Code area, I paste in the code I copied from the GA Admin. I keep getting an error that says this: One or more of the fields contains invalid characters. Please make sure that your entries do not contain any angle brackets like < or >.

This is our GA code

<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-90804181-1', 'auto');  ga('send', 'pageview');

</script>

Thanks for your help

Brad


  • Photo of Brian Kalwat

    0

    Brad,

    You shouldn't need to add the whole tracking code to your site templates - if you go to Admin Tools > CMS Configuration > Sites and click on a site, there is a field for your GA unique ID. That should be all you need to add to get it working.

    Hope this helps,

    -Brian