Warning: This method may or may not summon unspeakable horrors to your webserver's performance.
If you're running PHP or a similar scripting language, you could do something really, really ugly - like this:
In the footer of pages you want to track:
<iframe src="/path/to/script.php?src=<?php echo htmlentities($_SERVER['REQUEST_URI']); ?>&user_ip=<?php echo $_SERVER['REMOTE_ADDR']; ?>" width="1" height="1" style="visibility:hidden;"></iframe>
In "script.php" or whatever you choose to name your timer script:
<?php
if ( @isset( $_GET['src'] )
{
$source = filter_var( $_GET['src'], FILTER_SANITIZE_STRING );
} else {
/* no source page to track */
die();
}
if ( @isset( $_GET['minute'] ) )
{
$minute = (int) $_GET['minute'] + 1;
} else {
$minute = 0;
}
$uri_refresh = ($_SERVER['HTTPS'] != 'on') ? 'http://' : 'https://';
$uri_refresh .= $_SERVER['HTTP_HOST'];
$uri_refresh .= '/path/to/script.php';
$uri_refresh .= '?src=' . $source;
$uri_refresh .= '&user_ip=' . $_SERVER['REMOTE_ADDR'];
$uri_refresh .= '&minute=' . $minute;
?>
<html>
<head>
<meta http-equiv="refresh" content="60;url=<?php echo $uri_refresh; ?>">
<title>Timed Logger</title>
</head>
<body style="color:#FFFFFF;">
<p>You have been viewing this page for <?php echo $minute; ?> minutes.</p>
</body>
</html>
... and then you can get a rough idea of how long people are viewing things by looking at the relative popularity of different minute
values in your server logs.