Forum Moderators: DixonJones

Message Too Old, No Replies

Easy way to track users screen resolution?

Script, freeware (no spyware) or something..

         

silverbytes

9:50 pm on Jun 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I need to know about what resolutions are my visitors using. the data is not in logs so I guess a script would help.
Can someone recommend a free way to track user's screen resolution?
jscript? php? a free non spyware software or else?

edit_g

10:34 am on Jun 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Some of the free stats programs will pick this sort of stuff up (google: free web stats). All high end stats packages will pick it up.

dmorison

11:49 am on Jun 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could get the data into your logs using JavaScript to render a single-pixel image request; containining whatever parameters you want in the query URL...

Something like...

<script type='text/javascript'>
document.write("<img src='restracker.gif?sw="+screen.width+"&sh="+screen.height+"' width='1' height='1' />");
</script>

...then you'd be able to get an idea by looking at your logs.

To take it a step further you could use PHP or something return the image and have it log sw and sh to a database - you need to provide the function reslog() of course...

<?php
header("Content-Type: image/gif");

reslog($_GET["sh"],$_GET["sw"]);

include('singlepixel.gif');
?>

If screen.width and screen.height are not exactly what you're after I think JavaScript provides canvas dimensions as well...