This class can be used to log Web site visitors in a MySQL database and compute statistics from the logged information.
It uses sessions to destinguish each visitor. It can determine the visitors county by looking up a database table with information of the countries associated to each IP address range.
It provides functions for display the visitor log entries or a log summary of the current month, consolidating the computed information by stored in a separate table so it is faster to lookup next time the consolidated information is presented.
The log summary includes visitor count, domain count, country count, most popular country, most popular domain and most popular day of the week.
The class supports recording information of multiple sites in the same database tables. |