I've just finished a website that uses quite a bit of Ajax. To allow page views to be counted, I called Google Analytics' _gaq() function manually. I also modified the URL passed to _gaq() to remove the #! so GA would record the page, rather than just the site, URL (though this didn't actually seem to work).
When Ghostery has GA blocking enabled, it injects a surrogate Urchin script that includes the lines
if (arguments[0][0] == '_link')
window.location.href = arguments[0][1]
If, as in my case, the URL passed in doesn't match the browser URL, the browser is redirected to this new URL, which doesn't seem ideal. The real GA script doesn't do this, though I haven't examined the older Urchin one.
This may only happen when the hash ends with a slash.
I've now removed the URL changing code from my site (as it wasn't working anyway), but it may be worth changing the script if you can so others don't trip over this.
Thanks very much for your time.
-
Hi Andrew, thanks for using Ghostery.
This is indeed an unintended consequence of the surrogate. I'll look into fixing it. Thanks for reporting this issue. -
Loading Profile...



Twitter,
Facebook, or email.

