frank_conijn — 2013-02-25T05:50:51-05:00 — #1
logic_earth — 2013-02-25T13:22:08-05:00 — #2
frank_conijn — 2013-02-25T13:31:07-05:00 — #3
So there are websites that send the following information to their servers: screen.width = x, screen.height = y? And on the basis of those data the servers compile their statistics? And how exactly would the sites send that code snippet to the servers?
pullo — 2013-02-25T15:21:41-05:00 — #4
AJAX, I would imagine.
It would be quite simple to fire off a small AJAX request containing any relevant user statistics when the page loads.
felgall — 2013-02-25T15:53:27-05:00 — #5
img = new Image();
img.src = 'process.php?height=' + screen.height + '&width=' + screen.width;
img = undefined;
That runs process.php on the server passing it the width and height of the screen that the browser is displayed on.
Most scripts would use a lot more code than that because most people don't realise that if you are just sending data from the web page to the server and don't need a response back that you can do it this way and only need three lines of code to pass as much information to the server as needed.
frank_conijn — 2013-02-25T16:25:51-05:00 — #6
Agreed, Dave, it would. But who has such an AJAX script on their site? Have you or anyone you know ever received a request from anyone to include such a script somewhere in the code so that the servers can collect resolution data? And to you the same question, Stephen.
pullo — 2013-02-25T16:27:10-05:00 — #7
I must admit, no I haven't.
I think most people who are interested in such things would use Google Analytics.
felgall — 2013-02-25T16:44:01-05:00 — #8
Pullo has answered Frank's question. Anyone using Google Analytics (or any other similar script that captures statistics about visitors) has a script in their page that captures such data.
I can't see any reason why anyone would bother to write code to do it themselves rather than to use a script such as Analytics that does it for you.
pullo — 2013-02-25T16:47:58-05:00 — #9
That's a neat trick felgall and I must confess I didn't know it before, so thanks for sharing
However, saying that, I was vaguely aware that some companies use images in HTML emails to find out if people read them (the emails that is), so I guess this would be a similar tactic, as in this case, too, there is no response needed from the server.
frank_conijn — 2013-02-25T19:07:57-05:00 — #10
OK, but how many years are there between the resolution stats being readily available and the appearance of Google Analytics? At least a number of years. How did servers compile their stats before GA?
felgall — 2013-02-25T20:34:33-05:00 — #11
The same way that analytics does it - using an ajax call of one type or another. The version I posted above works in any browser that supports images. The more conventional XMLHttpRequest type of call has been available to use since IE4. The XDomain and XHR2 calls that analytics actually uses now have only been added in more recent browsers.
Basically any browser from Netscape 2 on has had the ability to send the information to the server in one way or another.
frank_conijn — 2013-02-26T16:57:52-05:00 — #12
OK, but who had that script/code snippet included in their code? Not the normal websites, I would think. Or are the statistics based upon the users of search engines like Google?
felgall — 2013-02-26T20:27:39-05:00 — #13
It used to be really common for web sites to include a counter on their page that displayed how many visitors the site had received. Capturing any stats about the visitors would have been a part of that script. There were literally hundreds if not thousands of different hit counter scripts around for people to choose from. Hardly anyone used search engines back then as they didn't find much in the way of useful results. Directories built by real people were far more popular back then. Google didn't come along until much later.
frank_conijn — 2013-03-02T05:30:15-05:00 — #14
It used to be really common for web sites to include a counter on their page that displayed how many visitors the site had received. Capturing any stats about the visitors would have been a part of that script. There were literally hundreds if not thousands of different hit counter scripts around for people to choose from.
That sounds plausible. Thanks for clearing it up, Stephen.