When your page loads, you can insert an entry into a database in PHP. This will give you the total number of page requests.
If you log timestamps and IP addresses (or any other state variables), you should be able to correlate the entries between the two insertions.
Or, another method would be to have the AJAX call update the row inserted by the PHP query. This would be a cleaner approach in my opinion.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki