Jump to content

Adding Google Analytics tracking I.D


Steve Silver

Recommended Posts

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

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

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

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...