Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Blog Module /

Discuss the Blog Module.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Google Analytics on the Blog Module?

Go to End



Community Member, 21 Posts

5 July 2010 at 4:35pm

I would like to put GA on the Blog module. So far I thought for other pages I could just modify and add the code there but as a SS neophyte, when looking at how Blog works, I couldn't see which template I should update or if indeed Blog does use the template. If it does, then I could just stick the code in this section

<div id="footer">
<div id="footer-valid">
<% include Footer %>

[ put blog code here]

The code I want to put in looks like this

<script type="text/javascript">

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-17218223-1']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);


Should this work?