Database controlled sessions are probably the easiest way. You can put the location they are currently viewing in there as well. Simply count from your database grouped by the page.
If you use predefined sessions, it will become quite umpleasant quite quickly.
Search on google for a database driven session script. Someone has to have posted one up.
header('HTTP/1.1 420 Enhance Your Calm');