Hi. I wasn't happy with the fact that Google Analytics doesn't record many of the hits on my sites, so I decided to roll my own analytics software, and opensource it. It's now in a state where I can request early comments. You can view a demo at http://mediabeez.ws/stats (under construction, may fail at times) (browser compatibility may be an issue, I built it with chrome, should work in firefox too, but won't (ever) in IE.) If you click on the graph while the details for a given day are visible, you will see the errors for that day in a DIV below the graph. Normally you'd hide the error details and $hits for anyone's who's not registred as a developer, of course. I've turned it on for all at the moment, so you can comment on that feature and review my results array $hits. I've opted, for simplicity of design, to store all settings I thought could be remotely interesting in a mysql db (see attached sql init file) (which is filled from PHP every time a page is delivered, and again from JS when the page has initialized fully, or does a HTML5 History API location.href change), and then use PHP to retrieve all rows for a given datetime-range, and do the totals calculations in a php loop. I'm only keeping 1 row from the db in memory at any given time, but I'm building up a large deep array with the totals information in the php loop that goes over the rows. I'm wondering if this is a good approach, though. Maybe I should let the totals be calculated by the mysql server instead. I was thinking to let the totals calculations stay in php, and be executed from a cron job every hour. Only for the current month would you need to re-calculate every hour. I haven't figured out yet how to for instance only re-calculate the last hour, store results per hour, and then calculate the day and month totals from that "hourly cache" data when needed. I don't have a clue about how big companies do their totals calculations (for sites that get way more hits than mine, which is something i'd like to be able to support with my own analytics code), and would like to know how big companies do this. I've included the relevant draft code as attachment files to this mail, for your review. Please let me know if I have forgotten to include relevant code.. As always, thanks for your time, Rene
Attachment:
hm.php
Description: application/httpd-php
Attachment:
rajmvServiceLog-1.0.0.php
Description: application/httpd-php
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php