Hello,
I'm helping some Ph.D students at my university with e-commerce user interface studies - building web sites with variable parameters that the experimenter can change, and record the impressions of the subject accordingly.
One of the things I need to track is how long a user spends on each page, along with the parameters the web site is using at the time. Currently, I have a javascript timer that runs in the background, and when clicking on a link, they first get taken to a PHP page that records the time they spent on the previous page - passed as a GET parameter - along with the filename of the page they were accessing, into a MySQL database. They don't see any of this, as the PHP page immediately redirects them to the page they originally wanted to go to.
This has worked reasonably well, however we're seeing some timing weird data pop up from time to time. I've thought about what could be causing them, and they all lead to the conclusion that the user was clicking the Back and Forward buttons instead of following the links, as dictated by the experimental procedure. If they click the Back and Forward buttons in their browser, the PHP page that intercepts the timing data never gets run, so they become invisible to us.
I'm wondering about what other techniques there are for timing web site usage and recording a user click-path through the site. Apache logs, for one. Does anyone have some experience with this? What works?