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:

Archive /

Our old forums are still available as a read-only archive.

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

Will Scott, Quin Hoxie - statistics code

Go to End

5 Posts   2220 Views


Administrator, 690 Posts

15 June 2007 at 1:25pm

Hi Will & Quin,

Will: you're working on a Google Analytics plug-in
Quin: you're working on a custom reporting system of some kind

It would make sense if your APIs were structured in similar ways where appropriate. For example, using similarly named methods to activate the various analytics engines.

Can you please discuss what both you're up to on this thread?


Google Summer of Code Hacker, 7 Posts

15 June 2007 at 6:48pm

So, I'm planning on doing two things that are of interest here.

First, Google Analytics is a good, free analytics tool, so there should be a simple way to add it to your site, i.e. there needs to be a painless way to paste in the javascript tracker google provides in the admin interface, and have it show up in the footers of all of your pages.

Secondly, I'm going to try to add some usage tracking code. My plan right now is to beef up the session class to keep some more information of how users and then glean some information of how the site is being used from that. I've got other stuff I'll be working on before that, but when I get to that point, it's probably going to both make the most sense, and be pretty neat to display that information with Quin's reporting stuff.

I glanced at the trac system, and I'm not sure if this is an issue, but if we're both going to be adding code to all pages (I'll be adding analytics snippits), then that's another place where we should have one method in Page.php to do that in, because that's a file that we want to keep simple and clear.



Google Summer of Code Hacker, 39 Posts

16 June 2007 at 6:51am

Edited: 16/06/2007 6:53am

For my reporting implementation, I am going to provide a system to generate a statistics report based on nearly anything worth tracking in the framework.
Ideally, items can be viewed in summary and detail as individuals, and then trends can be shown with comparing two or more items.
Most all data in the system will be displayed with graphs, tables, and then able to print or export to csv.
This data will all be available through the cms, but there will also be means to make certain parts of the reports available as part of the public site.

One thing that I can see right away would go together well would be the addition of the Google Analytics option in the Statistics tab of the cms. If that suits you, of course.

Also, in response to your comment about page.php. I asked Sam about basically the same thing, and he suggested that I use contentcontroller.php for those needs. I figure that aspect of our implementations should be unified, so does contentcontroller work for you, or should we hash out other options with the mentors?


Google Summer of Code Hacker, 7 Posts

16 June 2007 at 7:11pm

Sounds good on both points!

The Google analytics stuff should be a pretty minor code insertion, so once it looks like you've got the statistics tab set up I'll go ahead and add that bit in.

contentcontroller.php looks like a very reasonable place to add in custom scripts to pages. I'll whip up a method for adding extra header/footer code to pages over the weekend.



Administrator, 690 Posts

17 June 2007 at 6:20pm

Yeah, Page.php isn't part of the SilverStripe core - it's part of your customised site. It's there for developers to put site-specific code in.

Nothing in the mysite folder is "part of SilverStripe", if you get what I mean.