开发者

Is the 1x1 pixel image technique a good way to capture analytics data cross-domain?

I see many web analytics application and 开发者_运维知识库otherwise use JavaScript to capture data on a client website, and then send it to a central server for processing/storage/presentation.

For a similar purpose I've been using a JavaScript snippet which generates a 1x1 pixel image request to the server. The request contains GET attributes with the data I want to capture (which can vary in size). This request may be generated millions of times per day, across thousands of websites (and multiple times on each website).

Is the 1x1 pixel image the 00's way to do it?

Are alternative cross-browser techniques (JSONP or others) mature enough to replace it, when dealing with an application with thousands of client websites?


I think the continued popularity of the 1x1 pixel is because every web browser everywhere (well, not Lynx or any browser that has images turned off, but don't tell the marketing folks about that) requests the image. The "cooler" methods of doing stuff aren't as universal just yet.

And the more complicated and code-involved the solution, the more you're going to run into browsers set to "paranoid" that won't execute the code. As it stands now that JavaScript might not get executed. Fitting that 1x1 pixel into the plain HTML would be more universal.

There's also the fact that this same method can easily be expanded to include cookie data. It's a standard web request, so cookies apply.

At the end of the day, it's not always about the "best" solution from a development perspective. Web development is often about the common denominator and working for as many visitors as possible, including the stuff the visitors don't know it's doing.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜