Forum Moderators: open
I've got a couple of stats from the usual suspects on the current dominant browser resolutions (i.e. 800x600 still very significant, but - depending on which stats you look at - no longer the leader).
However, I've trawled around and still can't find the answer to this - how, exactly, do I go about retrieving stats on what *my* site's visitors are using, so I can assess the potential impact of a width redesign? I've come across loads of scripts and packages that include this as part of a full analytics pack, but nothing that *just* sets things up so I can collect this kind of data routinely.
Any tips would be very gratefully received.
Many thanks,
Rachael
We do it like so:
IN HTML
<script>
document.write('<img src="/scripts/screen.pl?dn=domainname&w=' + screen.width + '&h=' + screen.height + '" width="1" height="1">');
</script>
PERL SCRIPT
use CGI;
$¦ = 1;
&Main();
$¦ = 0;
sub Main {
my ($query);
my ($data);
my ($domain);
$query = new CGI;
$domain = &taintCheckSub($query->param('dn'));
if ($domain ne 'yoursitesdomainname')
{print "Location: h*tp://www.yourdomainname.com/images/dot.gif\n\n";}
$data = $domain . "\t" . localtime($^T) . "\t" . $query->param('w') . "\t" . $query->param('h');
&logAppendSub ("/pathtologfile/screen.log", $data);
print "Location: h*tp://www.$domain.com/images/dot.gif\n\n";
return 1;
}
1;
Obviously, you'll have a little work to do yet, but this works very nicely for us.
[edited by: BlobFisk at 10:16 am (utc) on Dec. 1, 2004]
[edit reason] Delinked example URLs [/edit]
<script>
document.write('<img src="/someimage.gif?w=' + screen.width + '&h=' + screen.height + '">');
</script>