views:

767

answers:

3

The Yahoo Javascript library (YUI), JQuery and less so Google maps all allow you to reference their files using the following format:

<script type="text/javascript" src="http://yui.yahooapis.com/2.6.0/build/yahoo-dom-event/yahoo-dom-event.js"&gt;&lt;/script&gt;

This does a request for the script from their servers, which will also pass to their web server the HTTP referrer. Do Yahoo etc. use this to produce statistics on which websites get what traffic? Or is this a conspiracy theory?

Of course their servers most of the time will be a lot faster than any small company would buy, so using the hosted version of the script makes more sense.

+1  A: 

Of course they produce statistics - at minimum they need to know how many resources they spend on hosting these scripts. And it's also nice to know who uses your code.

I don't think it's a bad thing.

And using a hosted version makes even more sense because your visitors might have the script already cached after visiting another site.

Rene Saarsoo
+1  A: 

Sure, they can easily have statistics about which sites use YUI and how often, and also which parts of YUI API are more populare (among small sites). However, they cannot know what exactly web site visitors do with their libs.

Given, that they (Google & Yahoo) index a lot of web pages, they can get an even more precise statistics if they analyze their indexes. So you cannot hide that you are using YUI if your site is public.

The same applies to Google maps and jQuery.

jetxee
Good point about the indexing, they have probably added searches for their scripts (and maybe even lines of javascript) so giving them your website usage stats isn't much different
Chris S
Sorry to rob you of points Jetxee, but Eric's answer is more official!
Chris S
+5  A: 

Chris,

I work on the YUI team at Yahoo.

We host only YUI on yui.yahooapis.com; Google hosts YUI and many other libraries on its CDN. I can tell you from the Yahoo side that we don't monitor site usage of YUI from our CDN. We do track general growth of yui.yahooapis.com usage, but we don't track which sites are generating traffic. You're right to suggest that we could track usage -- and we state as clearly as we can in our hosting docs that you should only use this kind of service if the traffic logs generated on our side don't represent a privacy concern for you.

In general, though, I don't regard CDN traffic for library usage to be a reliable measurement of anything. Most YUI usage, even at Yahoo, doesn't use yui.yahooapis.com or Google's equivalent, and I'm sure the same is true for other libraries. And even when a site is using YUI from our servers, we wouldn't have comprehensive traffic data of the kind you'd get from Google Analytics or Yahoo Analytics -- because not all pages would use YUI or the CDN uniformly.

Given the advantages of the hosted service -- including SSL from Google and YUI combo-handling from Yahoo -- I see the CDN as being a big win for most implementers, with little downside.

-Eric

Eric Miraglia