soeren says

FYI: plug-in statistics

September 26th, 2007

I’ve written some code (JavaScript with MochiKit extensions on the client side; relatively bare-boned PHP on the server end) that checks for whether certain plug-ins are installed in your browser. I’m doing this primarily to find out the penetration rate of the DivX web plug-in among my readers, which I unfortunately expect to be fairly low.

Let me elaborate on both ends.

First, why DivX? I’m actually not much of a fan of DivX. However, I’ve been utterly disappointed with the lack of quality of most video sharing sites out there, especially YouTube (which by default scales images up in its viewer), but also most others I’ve heard of. Such sites also tend to transcode your video content, so you’re pretty much forced to lose quality beyond what you’ve already lost. (Naturally, uploading the video uncompressed, or even losslessly compressed, just isn’t feasible.) Enter Stage6: a much higher quality level, and no re-encoding on their end (though their pages, too, scale the video up slightly by default. What’s up with that?)

The downside is that, unlike Flash Video, DivX is only widespread on desktop players, not within a web browser. Part of the reason is that the DivX web plug-in is relatively new as well. The QuickTime plug-in, for instance, has a far larger install base, but I’m not aware of any sites that use it, and I’d rather not deal with the hosting myself.

So as far as I can see, to get a decent amount of quality, there’s no way around Stage6. But Google Analytics only keeps track of users who have Flash Player or Java installed, not DivX.

Thus, I’ve written some relatively simple JavaScript this morning that checks the navigator.plugins on whether certain plug-ins are installed (specifically, I check for DivX, Flash, Java, QuickTime, Windows Media and even RealPlayer, though chances are most of those won’t matter to me in the end). For Internet Explorer users, I check for particular ActiveX components. There’s no sniffing going on, so it should be about as cross-browser as it gets.

The results are concatenated and submitted using AJAX to a PHP script, which deserializes an associative array, adds the new results and reserializes it. Finally, I also have (for now) a little hidden div that will be filled either with “FAIL” when something went wrong, or with the percentage (as decimal) of users that have DivX vs. total users that submitted their results.

I’d like to stress that there is nothing personal about this information. No machine ID, no username. I don’t even store a cookie about it. The entire resulting stored data, if expressed as JSON, will literally look something like this:

{
"RealPlayer": 8,
"Java": 8,
"Flash": 8,
"DivX": 6,
"QuickTime": 8,
"WindowsMedia": 5,
"total": 8,
}

(That’s it!)

Also, this shall be a temporary thing; once I’ve made up my mind on what video site to use, there probably won’t be any point to this tracking any more. No promises, but I don’t think I’ll be keeping this (and I certainly won’t in its current, inflexible form).

You may be thinking: why not just a poll? Sure, the work of implementing polls on here would have been similar, if not less (such as by using an existing WordPress polling plug-in). But experience tells me there would not only have been far fewer results, but also less accurate ones: those most interested in the subject would be most likely to vote on it. As a slightly contrived example, an enthusiast for the stage6 site would certainly vote for DivX, whereas those who couldn’t care less (and consequently may also not have the DivX web plug-in installed) wouldn’t vote at all, rather than voting that they don’t have it. Statistics are collected automatically; you’d have to put extra effort into opting out (such as by blocking URLs beginning with http://chucker.mystfans.com/plugin-statistics/). Thus, this choice should lead to relatively good results.

This is all, by the way, for the future iteration of soeren says, which has made some interesting progress. I’ve become increasingly certain that it will indeed not run WordPress at all, but that I’ll rather have nanoc precompile some HTML and CSS, as well as some JavaScript and even PHP.

Plus, it’ll have some purple. Those who need to will know what that means. :-)

Posted in This Blog

Share

Your Own Thoughts

I'd love to hear your input. Just try to stick to a few rules:

Before you comment for the first time (or, after you have deleted cookies), you will have to answer a little challenge to prove that you are not a spammer.

Comments are written in Markdown.

Leave the country the same, but correct the continent, and end the sentence with a period instead.