7 ms·
Fixing Google Analytics for Ghostery
- thezilch 14y agoI'm not convinced the defined track function is fixing what's described. If following Google's instruction for "installing" ga.js [0], there shouldn't be any sites breaking that block ga.js from loading. That is, Google suggests var _gaq = _gaq || []; at the start of the script installation. If ga.js never loads, _gaq is still an array and can be pushed onto to your heart's content. If you're concerned with an ever growing array of garbage, the suggestion in the comments is great: __gaq = __gaq || {push: function(){return 0}} [0] https://developers.google.com/analytics/devguides/collection/gajs/asyncTracking https://developers.google.com/analytics/devguides/collection...
- jeresig 14y agoIf that's the case then there are a lot of sites that are willfully ignoring the correct snippet. Perhaps this was something new that they added recently - or perhaps there's a frequently-incorrect snippet that's copied?
- yahelc 14y agoNo, it's not particular new or regularly misimplemented. It's usually implementing cross-domain tracking that breaks things, not regular use of GA, because it does `return false` in an onclick handler. I have some fixes for that here: https://github.com/yahelc/GA-Better-Crossdomain-Tracking https://github.com/yahelc/GA-Better-Crossdomain-Tracking
- jeresig 14y agoThe issue you outline is tangential (but still important). The issues I'm seeing are actual exceptions occurring where sites are missing the reference to the GA object, not issues with _link tracking and redirects.
- yahelc 14y agoCan you provide live examples? `_gaq.push([]);` shouldn't result in any errors with Ghostery. I'm curious as to what's happening.
- thezilch 14y agoHonestly, it could be either. Though, I can't recall anything different after the move off urchin.js -- years ago [0]. What's worse is those that call "private" methods directly; for example, some use _gaq._link(...) over _gaq.push(["_link", ...]), which unravels a mess really quickly if you want to provide surrogates for all the methods exposed by _gaq [1]. [0] 2010, Dec 09 11:12:41 -0800 commit on a site that would be most likely "with the times" [1] https://developers.google.com/analytics/devguides/collection/gajs/methods/ https://developers.google.com/analytics/devguides/collection...
- apaprocki 14y agoOne thing that you need to keep in mind -- if you back-off from CDN loading to loading a local copy, you'll almost never be testing that scenario so be careful that a massive influx of local requests in a CDN-is-down scenario doesn't melt things. It brings up a broader topic of reliability testing.. every one of these branches inserted into the code creates another point at which performance/load metrics change. Testing all the various combinations can be difficult.
- LaGrange 14y agoActually, a cool ghostery-like expansion would be replacing CDN links with things stored inside the extension. This would both save some web requests, and let me completely ignore google's CDN in case I feel particularly paranoid.
- gav 14y agoI see this more frequently, sites are adding dependencies on third-party Javascript for tracking, and when they are unresponsive (or blocked with something like Ghostery) the site's functionality breaks. This is especially worrying for e-commerce sites, you don't want to prevent people adding things to the cart and losing orders.
- jakub_g 14y agoI've seen that a couple of months ago on the page of a big airline. Since I had google-analytics.com domain blocked in HOSTS, it took me a while to realize the issue. However it was the only time it happened to me in many years (other than deliberate "please disable adblock to see the page"). Very soon they redesigned the whole page and now it works fine.
- graue 14y agoWas that United Airlines? A few months ago their reservation site broke for me with AdBlock/Ghostery. I just used a different browser entirely, but in retrospect I suspect it may have been Ghostery's fault.
- jakub_g 14y agoNope, it was LOT (national Polish carrier). Not that big as United ;) but significant in central Europe.
- ahmednadar 14y agoI have not been so fan of most of google work. I do have Gmail account, but that's it. In the past I used use other services such as, search, websites, doc, Google+, ... but not any more. Even Chrome, I use it for testing and nothing else. Few years back, Chrome has launched what is been described as Evil EUlA [https://duckduckgo.com/?q=google+chrome+evil+eula https://duckduckgo.com/?q=google+chrome+evil+eula] because of what the EULA at that time contained, as fellowing: 11.1 You retain copyright and any other rights that you already hold in Content that you submit, post or display on or through the Services. By submitting, posting or displaying the content, you give Google a perpetual, irrevocable, worldwide, royalty-free and non-exclusive licence to reproduce, adapt, modify, translate, publish, publicly perform, publicly display and distribute any Content that you submit, post or display on or through the Services. This licence is for the sole purpose of enabling Google to display, distribute and promote the Services and may be revoked for certain Services as defined in the Additional Terms of those Services. Now its been changed: 11.1 You retain copyright and any other rights that you already hold in Content that you submit, post or display on or through the Services. Although they clean their evil mistake but i never used Chrome, i lost respect for them. As its clear Google search engine is the best even after Bing attempts. But still i don't trust them, I see they know more about me as user while using their search. I did not need that much time to find out they do collect data, track every thing I search for. Recently I ran into [http://www.duckduckgo.com http://www.duckduckgo.com] where they set them self different from Google as "We believe in better search and not tracking." Then i said bye bye google search. I have ghostery installed in Firefox and I love it. Basically I block any script for Analytics, tracking, privacy and advertising. Check out what AdSense do behind the scene: [http://www.ghostery.com/apps/google_adsense http://www.ghostery.com/apps/google_adsense] Data Collected: Anonymous (Ad Views, Analytics, Browser Information, Cookie Data , Date/Time, Demographic Data, Hardware/Software Type, Interaction Data , Page Views , Serving Domains) Pseudonymous (IP Address (EU PII), Search History, Location Based Data, Device ID (EU PII)) PII (Phone Number) Data Sharing: Anonymous data is shared with 3rd parties. As you see while you are searching your info (which google got them for free, because you trust them or you don't know) is been sold for third parties. I want to feel safe and not been watched for what I browse and search online. That's why I like my new trust search engine [http://www.duckduckgo.com http://www.duckduckgo.com]
- deleted 14y ago
- OGinparadise 14y agoAFAIK, no site breaks, even if you block them totally via hosts or Ghostery.
- cheald 14y agoUntil someone makes a call to window.gaq which doesn't exist because you've blocked GA, which causes their JS to bail out.
- shabble 14y agoI was poking around at NoScript surrogates for GA the other day, I reformatted the code they're using in a comment here[1] Seems to be using the special (to FF, at least) __noSuchMethod__ property[2] to catch all calls to the GA object. [1] https://news.ycombinator.com/item?id=5182359 https://news.ycombinator.com/item?id=5182359 [2] https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/noSuchMethod https://developer.mozilla.org/en-US/docs/JavaScript/Referenc...