Steve Silver Posted November 6, 2019 Share Posted November 6, 2019 Tried adding a Google Analytics tracking I.D into the 'Analytics' CP, code looks something like, e'g; UA-95867698466 but once I add this - it then appears as text literally at the top of the index page header! Anyone know if this is an error? or there's a different way to add the Analytics code? Link to comment Share on other sites More sharing options...
Jim M Posted November 6, 2019 Share Posted November 6, 2019 You'll want to use the whole tracking script that Google provides. The "UA-..." ID is just your account ID. The tracking script is Javascript so will start with a "<script..." and end with "</script>" (of course without quotes). Link to comment Share on other sites More sharing options...
Daniel F Posted November 6, 2019 Share Posted November 6, 2019 4 minutes ago, Steve Silver said: Tried adding a Google Analytics tracking I.D into the 'Analytics' CP, code looks something like, e'g; UA-95867698466 but once I add this - it then appears as text literally at the top of the index page header! Anyone know if this is an error? or there's a different way to add the Analytics code? You'll need to use the full analytics js code Link to comment Share on other sites More sharing options...
Adlago Posted November 6, 2019 Share Posted November 6, 2019 7 minutes ago, Steve Silver said: Tried adding a Google Analytics tracking I.D into the 'Analytics' CP, code looks something like, e'g; UA-95867698466 but once I add this - it then appears as text literally at the top of the index page header! Anyone know if this is an error? or there's a different way to add the Analytics code? Add this script <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-95867698466', 'auto'); ga('send', 'pageview'); </script> Link to comment Share on other sites More sharing options...
Steve Silver Posted November 6, 2019 Author Share Posted November 6, 2019 Fantastic - added correct script + own ID, now all working, Many Thanks - much appreciated, great community here. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.