Jump to content

Basic site analytics


GuruMeditation
 Share

Recommended Posts

Hi all,

I plan on adding some basic analytics to a site I'm working on. Piwik would be overkill as I only plan on logging what pages members have viewed, along with the time and other basic information.

But what would be the most efficient way to go about it? This site is on a shared hosting account, although it is a reliable shared hosting company, and it can handle a couple of thousand members accessing a forum etc without any problems.

Personally I'm thinking of using the $log API variable to store this information, but was curious what others thought.

Thanks

Link to comment
Share on other sites

Hi Guru,

one thing that comes to my mind is caching: If you are caching your pages, you can't just simply put your counting logic into a template as PHP. You need a request via javascript or a counting pixel.

I understand your 'overkill' argument here, but I guess the extra data you could mine wouldn't hurt anyway ;) I would still prefer tools like Piwik or Google Analytics. No need to reinvent the wheel here. Those tools can get you a lot more reliable data than you could implement on your own in a reasonable time.

I installed Piwik on a second host to split the load btw.

If you still want to keep it simple and do it on your own, I would just use some fields that are present on any template. Maybe create a module for that and move the fields to a 'Stats' tab or something like that. But that surely depends on what kind of data you want to keep track track of. That method would wok with simple request counting, but not if you want to track devices and stuff for example. I don't think that $log is the right place for that kind of content, but that's just me. The $log API logs into files, which could get nasty with heavy load in terms of IO, response blocking and maybe race conditions. Also you would need to analyse/calculate big files, which isn't fun...

Cheers

Link to comment
Share on other sites

I love custom stuff, too :D So I'm having little custom analytics, or extended page views..

however, every public page gets automatically a statistics page created, because I thought, that when I'm saving something in the backend it could interfere with statistics being automatically saved by api.

Would it work when the statistic fields life in a custom tab which is set to "open in modal" ?

And even on the seperate statistics page, what happens when too many people are viewing the same page?

I save the statistic fields individually by $page->save("pageviews") for example.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...