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:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Google Analytics

Go to End

3 Posts   4257 Views


Community Member, 3 Posts

20 May 2011 at 4:33am


I've just signed up for Google Analytics to proivide me with data about the company website. I have the script I need to put on each page I want to track, but when I click "view HTML" in the CMS and paste the script, it doesn't seem to add it to the page. Also, this is not a *full* HTML, as all it displays is "<p> content </p>, and I can't see any headers or other information I might want to manipulate.

How can I add this Google Analytics script to my site?


Community Member, 72 Posts

20 May 2011 at 8:51am

Edited: 20/05/2011 8:52am

I guess I should ask, are you only trying to track one page or every page?

With silverstripe you can't just add google's code to a page through the CMS. The headers that you will need to work in are in the php files (i.e. page.php) and/or the ss files.

There is one or two google analytics modules out there,

or there is a tutorial on how to put it in yourself here:

I used the SSBits tutorial so I could do some custom stuff, it also helped me learn more about how modules work and are built.


Community Member, 3 Posts

20 May 2011 at 8:57am

Ideally I'd track every page, but it's not necessary to track them all. At any rate, I'll be tracking multiple pages. Thanks for the links, I'll check those out and see what I can do.