Hello Daniweb,
I want to make a custom visitor tracking tool and like Google Analytics it must be able to track how long time visitors spend on each page.
How do you recommend doing this?
I thought of using the Javascript onload event to start counting time serverside and then the onbeforeunload event to do tell the server to end the time count. I'm just skeptic of an infinite visit duration if the visitor's browser for some reason doesn't call the event (ie power outage).
Any ideas? I'm using PHP server side and looking for a most cross browser compatible solution.
I am aware that precise measurement of this is not possible.
Kind regards,
Excizted