How to stop Google from tracking your clicks

By

Stop the madness
Stop! The! Madness!
Photo: Charlie Sorrel/Cult of Mac

Whenever you click a link in a Google search, it replaces the URL of the site with a tracking URL. If you hover over a link with your mouse before you click it, Safari will show you the full URL of that link. It’s a great way to check where you’re about to get sent. Google plays along with this, showing you the proper URL for the link in question.

Only when you actually click on it, it swaps out that link, replacing it with its own tracking link.

Fortunately, there’s a way to block this sneaky, underhanded and totally unsurprising behavior.

Of course Google tracks you

Nobody is surprised that Google tracks them, but that doesn’t mean you have to like it — or even accept it. Especially when the tracking is deliberately obfuscated like this.

Even if you trust Google to “only” track you, and not actually do anything nefarious when it hijacks your clicks, this URL-swapping behavior could pose a big security risk on other sites. Checking the URL before you click a link is standard practice for careful web browsing. This breaks it.

So what is happening exactly? Here’s Jeff Johnson, the developer of StopTheMadness, a Safari, Chrome and Firefox extension that “stops web sites from making your browser harder to use.”

When you click on the link, the onmousedown action runs some JavaScript that swaps the original URL with a new tracking URL. Google does this as you click, right under your nose. Or finger.

Johnson is talking specifically about ⌘-clicks, which open links in new tabs. But it applies to regular clicks, too.

StopTheMadness

The StopTheMadness test page is a real eye-opener.
The StopTheMadness test page is a real eye-opener.
Photo: Cult of Mac

To cure this awful behavior, you install Johnson’s extension. Not only does it protect you against Google’s click-hijacking behavior, it also removes other blockages that developers often bake into their sites. For instance, have you ever been prevented from selecting text? Forced to type a long password instead of pasting it? StopTheMadness stops this, well, this madness. Here are a few of its protections:

  • Cut, copy, paste
  • Drag and drop
  • Text selection
  • ⌘-key shortcuts
  • Contextual menus

Cult of Mac wrote about StopTheMadness last year, if you want to know more about this essential tool. I like it because it stops Google swapping in its tracking code.

And if you want some fun, visit the StopTheMadness test page, which “shows some of the terrible power a web site has over your browsing experience.”

I just tried it on the iPad, and it’s an eye-opener to be sure. For many of these annoying behaviors, I previously assumed Mobile Safari was at fault. Not being able to drag images out of pages, for example, which is something I want to do all the time.

Unfortunately, there’s no way to install extensions like StopTheMadness on iOS. But it’s pretty essential on the Mac. Just make sure you read about it first — there’s no point installing an extension to protect your browsing if you haven’t done enough research to know you can trust it.