Analytics entry in Theme panel

Posted in: Newspaper
Post count: 145

Since I don’t see this topic in the theme documentation I found the following suggestion on the net on how to enter the code. I have simply copy-pasted the code in the Theme panel’s Analytics section and replaced the ID with my ID. I need to know if this is the right way of doing.

———————–
Adding the following code (known as the “JavaScript tracking snippet”) to your site’s templates is the easiest way to get started using analytics.js.

The code should be added before the closing </head> tag, and the string ‘UA-XXXXX-Y’ should be replaced with the property ID (also called the “tracking ID”) of the Google Analytics property you wish to track.

Tip: If you do not know your property ID, you can use the Account Explorer to find it.

<!– Google Analytics –>
<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-XXXXX-Y’, ‘auto’);
ga(‘send’, ‘pageview’);
</script>
<!– End Google Analytics –>
———————————-

Thanks.

Post count: 22421

Hi,
The google analytics code needs to be added in the theme panel – analytics section here: http://screencast.com/t/Lut4Il2RjqE8
Thank you!

Post count: 145

Sure. My question was how does the code look like? Is it a two liner or like what I sent you above?

Post count: 22421

Hello,
This depends on how google creates the code. I cannot say for sure as there are multiple types of codes google can provide. You can follow this guide and then simply paste the code in the analytics section : https://support.google.com/analytics/answer/1008080?hl=en
you only need to add the script itself encased in the script tag https://developers.google.com/analytics/devguides/collection/analyticsjs/
Thank you!

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newspaper’ is closed to new topics and replies.