Embed a php file in your page as an image.
<script>
document.write("<img src=\"/screen_res.php?width=" + screen.width + "&height=" + screen.height + " width=\"1\" height=\"1\">");
</script>
on screen_res.php you can redirect to a transparent gif or just set the content-type to "image/gif" and print out the code for a transparent gif. this is the code that I use.
<?php
// output of 1 pixel transparent gif
// for counters etc.
// Ulrich Babiak, Koeln 1999/11/30
// some Headers to prevent caching
Header("Content-type: image/gif");
Header("Expires: Wed, 11 Nov 1998 11:11:11 GMT");
Header("Cache-Control: no-cache");
Header("Cache-Control: must-revalidate");
// This prints the raw 1 pixel gif to the browser
// make sure this is one long line!
printf ("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%
c%c%c%c%c%c%c%c",71,73,70,56,57,97,1,0,1,0,128,255,0,192,192,192,0,0,0,33,249,4,
1,0,0,0,0,44,0,0,0,0,1,0,1,0,0,2,2,68,1,0,59);
?>
// the gif is done,