PHP and storing stats

Posted by John on Stack Overflow See other posts from Stack Overflow or by John
Published on 2011-01-15T09:47:37Z Indexed on 2011/01/15 9:53 UTC
Read the original article Hit count: 178

Filed under:
|
|
|

Using PHP5 and the latest version of MySQL I want to be able to track impressions and clicks for business listings. My question is if I did this myself what would be the best method in storing it so I can run reports? Before I just had a table that had the listing id, user ip address and if it was a click or impression as well as the date it was tracked. However the database itself is approaching 2GB of data and its very slow, part of the problem is its a pretty simple script that includes impressions and clicks from anyone including search engines and basically anyone or anything that accesses the listing page.

Is there an api or file out there that has an update to date list that can detect if the person viewing is a actually person and not a spider so I dont fill up the database with unneeded stats? Just looking for suggestions, do I just have a raw database that gets just the hits then a cron job at night tally up for the day for each listing for each ip and store the cumulative stats in a different table?

Also what type of database should it be? Innodb? MyISAM?

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql