Hi everyone,
I was just wondering everyone’s thoughts on the best way collecting visitor statistics.
At the moment when a visitor visits my site I insert the current time stamp, IP address, browser, operating system and referrer into a database. I only record a given IP address once every 24 hours to try a keep the database size down. Now I’ve decided it would be nice if I could see what pages are the most popular which would mean scrapping the “record an IP address once every 24 hours” and recording everything for every single page load.
Now obviously this would scale horribly. If I get 60,000 hits that’s 60,000 database entries. Can anyone think of a better way of doing this? I was thinking of running cron ‘clean up’ script at the end of each week which would count up the statistics for the week and insert the summarised info into a separate table.
I am aware of solutions like Google Analytics but what I’m looking for is something I can build straight into my application.
Cheers,
Mike