Pages

Monday, 26 October 2009

Google search results redirection - rightclick won't copy direct URL? Solution






When you rightclick a link in Google search results (especially in the Firefox browser), do you find that instead of the "real" direct link to the webpage concerned, you get a very long link with "google.../url?" in it - something like http://www.google.co.uk/url?sa=t&source=web&ct=res&cd=1&ved=0CAwQFjAA&url=http%3A%2F%2Fwww.google.com%2Fhelp%2Fbasics.html&ei=tu7aSoGkBciL4gbljcD2CA&usg=AFQjCNFz4A-LTbUBTeRMfDXQIVaV8JsJhA&sig2=L_1ekrgaLu5e4QQDDBGEVw ?

Hovering over the initial search results link without trying to click anything shows the correct direct link in the status bar (outlined in red below):

And clicking to open the link works.

But if you rightclick the search result link, e.g. in order to choose "Copy Link Location", you get the very long link instead:

This can be very annoying if you're trying to copy and paste links from Google search results for notes, emails, blog posts or slides etc.

It's not just you and me, others have noticed this too.

What's happening?

Why is this going on? It's because Google have randomly selected you, yes, lucky you (now one of the chosen many), to have this search redirection happen to you every time you do a search via Google while you're already logged in to a Google account (e.g. Gmail or Google Reader).

Link redirection. The search results links of the chosen many will then get turned into special Google "redirect" links, so that when you click on a link it will send you to the right place eventually - but meanwhile it's been redirected through Google, so that they will know (and presumably store a record of) exactly which links you clicked on.

This redirection happens even if you don't rightclick on the link first. Just keep an eye on the status bar as you left click a search result, and you'll see the long Google URL flash up there for an instant before the "real" page comes up.

Also note that this happens with "normal" search results in the main body of the page. In other words, they don't just track clicks on advertisements (which is expected and catered for), but clicks on any (non-ad) search results.

Rightclick broken. Now, tracking which Google search results you click on has privacy implications in itself and may be creepy or scary to some, but for many the main issue is simply that this link redirection breaks the rightclick functionality in your browser - you just can't copy direct search results links properly anymore.

Privacy - no opt out. A big problem is, once you've been chosen for this special treatment, you may find it happening all the time while you're logged in, whether you like it or not - Google don't alert you to it, and Google don't seem to provide any way for you to disable it or to opt out of this click tracking.

Personally I think this practice might well give rise to a legal risk for Google, because the initiation of the tracking isn't notified to the chosen many (who are signed in to their Google account at the time, and therefore probably personally identifiable) - and not only is the user not told about the tracking, but they aren't given the opportunity to consent to it or to opt out either. Nor are they told how the info from the tracking is to be used.

So for their own protection and for good PR as well as to help users, I feel Google should provide an opt out for this. There are indications that the redirection is going to happen automatically for all Google searches eventually, so maybe they'll update things then.

Anyway, until an opt out is available, if you're one of the chosen many there are a few things you can do to sort this out for yourself.

Solutions to the problem

Log out of Google! To fix this problem, the easiest solution is simply to log out of Google first before you search. A gotcha: if you do, though, make sure you sign out of all Google accounts first e.g. Google Calendar as well as Gmail etc, as signing out of just one of them, like Gmail, won't necessarily sign you out of the rest, like Calendar.

Use another browser for searching. However you may not always remember to log out of everything, and you may well need to have access to your Gmail etc during a search. One workaround is to open another type of browser (e.g. Opera or Internet Explorer, if you're logged in to Google via Firefox), and search in that browser, making sure you're not logged in to Google on that browser. Or use Bing to search!

Greasemonkey script. The easiest solution, if you use Firefox as your main browser, is to install a Greasemonkey user script. This fix is what I personally use.

I looked at the source and noticed the "onmousedown" event handler associated with every search result link. Rather than write a script to get rid of it, being lazy I did a search and sure enough others had already written scripts to address this issue.

The one I tried, which I know works, is the Google Search - Remove Redirection userscript.

(If you're not familiar with Greasemonkey, here's how to install the Greasemonkey extension and how to install a userscript. Both are free, as is Firefox.)

13 comments:

Anonymous said...

What does Google and spyware have in common?

Bill Marshall said...

Hi, interested to find this while searching for a solution to a very similar redirect problem. If (and it may be a big if) this is indeed related then I'm not sure it's as simple as this.

I first saw an issue a few days ago - results in a Google search were being redirected to other sites via various stages. In most cases the results were of similar subjects and were often competitors of the site clicked on. But it didn't happen every time the link was clicked. It seemed to happen on both sponsored results, Right Hand Adwords results, and usually the top few natural results.

I assumed initially that it was a malware/trojan infection and spent the next two nights trying to find and eradicate it using various tools. Nothing ever showed up, nothing fixed it. A slight difference to your case is that I was seeing the long redirect URLs in the status bar, not just in the right-click or the result.

Maybe it's Google, maybe it's malware, I'm no longer sure. In some cases I was seeing the problem in Safari and IE. My two other machines aren't seeing it so far. I've installed the Greasemonkey script you mention and will watch carefully.

thanks

Anonymous said...

I want to store that long google link in a php variable, each time when a user perfoms a query.

Can anyone help me on this ?

ahmedclever@hotmail.com

Anonymous said...

hi, i noticed that 2 weeks ago, i'm using firefox and not see the long link when using IE.

If i logged out google account and use firefox to search again the last charactor gone, this code

&sig2=L_1ekrgaLu5e4QQDDBGEVw

so, i think the &sig2=xxx is my user, right?

but i tried to understand the rest but still not understand what it's mean

for example my trial search word "acer aspire one"

http://www.google.com/url?sa=t&source=web&ct=res&cd=1&ved=0CAcQFjAA&url=http%3A%2F%2Fwww.acer.com%2Faspireone%2Faspireone_8_9%2F&rct=j&q=acer+aspire+one&ei=S4pWS8voGoqUkAXK0uTwBA&usg=AFQjCNG99kcc_LQ6b0ea8N6e2Z7RRjC2yg

when repeat click "search" button the difference when right click is only "ei=S4pWS8voGoqUkAXK0uTwBA", do you know this is for?

thank for share too

Anonymous said...

Really useful, thankyou! Google redirect links were driving me nutty. The greasemonkey script didn't work for me, but just using another browser where I wasn't logged into gmail solved the problem.

Anonymous said...

Google uses a script to enable those redirected links, but I used Adblock to get rid of it. Here's the bit I added to my blockable items list:

http://www.google.com/extern_js/f/

I realized it was a script when I turned off Javascript while using Google. None of the links were redirected anymore.

I only used the first bit of the the script that Adblock revealed on the google page (the script is much longer) -- but it effectively put an end to that annoying redirection.

Anonymous said...

Use Firefox extension >> NoScript <<
to disable this shit

Improbulus said...

Anon, I use NoScript too, but if you use things like Gmail you need to let some Google scripts through. If you've figured the particular domain to block that will stop this but let other Google services work, please let me know!

TenVolt said...

This is very annoying and I hope Google gets rid of this...

In Google Chrome I just keep an "Incognito Window" open for Google searches (click on the Wrench Icon to the right of the address bar, then choose New Incognito Window, or press Ctrl-Shift-N. This window doesn't send any browser info or cookies to the sites you visit, so they won't know that you're logged into Gmail or whatever, and hence won't muck up your URL's.

Anonymous said...

There is another possibility to remove this Google "feature": install Redirect Remover extension (https://addons.mozilla.org/cs/firefox/addon/redirect-remover/) and try the choice "Copy Cleaned Link Location" ;-)

Anonymous said...

Thank you so much for posting this -- it was driving me crazy, and had suddenly started happening when I was signed out of all Google accounts.

Anonymous said...

This behavior even occurs without being logged into a Google account. I keep gmail open in IE's in private mode and will copy/paste links from email into a new browser window.

Using IE's restricted sites for Google.com will block the active scripting which does this but I'm trying to relax the restrictions and still block the behavior. So far I'm not having much luck.

Anonymous said...

TenVolt, yes, seems like it works. Search addons for mozilla "Redirect Remover". I personally installed two of them - np since with unasked f00ken google redirects