Hi,
I'm having trouble with adding google analytics to a site. I've followed what I've found on the internet and created a global content block called "analytics" and added {literal} UA-3730606 {/literal} to that block. I have then added {global_content name="analytics"} to my templates but the actual analytics code is showing on my site, how do I make it so it's hidden?
Thankyou.
adding google analytics
Re: adding google analytics
Make sure to disable the WYSIWYG editor first for that content block!
Further I'd assume you have to put the whole analytics code inside the content block
Further I'd assume you have to put the whole analytics code inside the content block
Code: Select all
<__script__ type="text/javascript">
{literal}
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-Y']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
{/literal}
</__script>
Re: adding google analytics
Thankyou Velden, that worked perfectly.
-
- Power Poster
- Posts: 1049
- Joined: Wed Mar 19, 2008 4:54 pm
Re: adding google analytics
Please add [solved] to the title