I'm not sure my subject really does a good job of explaining what I'm asking here, but what I'm doing right now is each time someone accesses a certain page I track it in the database so I have a count of how many times that page has been accessed. But what I'd like to do is not actually count that a particular page was viewed until the user has been on it, say, 8 seconds. How could I pull that off?
Use 'onload' to start some javascript running when the page is loaded. After 8 seconds the script can use AJAX to make a call to an sql database logging the hit.
log the session id and the time the person first enters the page. whenever they go to another page, log the new time and compare the two, if the time is greater than 8 seconds, then record that the previous page has been visited. Overwrite the first time recorded with the new time and repeat the cycle. The flaw with this system is that it wont record the last page viewed as been viewed... If you're using AJAX, I suppose you could have a javascript time counter that coutns to 8, then records the page as been viewed...