Hi,
If you do a query in google you will get lot's of sites with loads of this sort of scripts. Unless you are like me.. (And thus painfully ignorant of other peples solutions) go with one of them..
I have been unable to get good manuals though. I am just building one from scratch. MAke sure you decide what you want to know from the statistics, do some calculations oon the amount of traffic & staorage space reuiqred, and pehaps talkt o some database design people to get a proper design (These tables fill up VERY quickly).
J.