Hacker News new | ask | show | jobs
by jurschreuder 442 days ago
People in China could not open a url sent in Gmail. I happened to be in China, I tried to open the webpage and it worked, no firewall.

I hovered on the link in Gmail and Chrome told me left bottom it was just that exact url.

But when I opened the url it got blocked by the great firewall.

Why? Any link in Gmail secretly gets replaced by a link to Google that tracks you and then redirects you to the original link.

The most obnoxious thing about this I think is that Chrome shows the original link.

3 comments

That’s a classic technique to track click through rates. Google.com has done this forever. The technique is to make an actual link in HTML (<a href=…>) then add an event handler which cancels the link’s default behaviour when you click it - and replaces it with javascript, or a tracking link.

I understand why Google.com wants that data. But in an email client it’s extremely obnoxious.

If it’s replaced with a tracking link, I think it might be just as effective to use the `ping` property on browsers that support it
Huh - I didn't know that existed. Its not supported in firefox or IE11 though - and probably will never be.

(IE11 probably isn't super relevant now - but it was almost certainly more relevant when that tracking code was written. You could use feature detection - but its much easier to just use their hacky javascript everywhere instead.)

https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorE...

https://caniuse.com/ping

I hate it even more in Google calendar where they don’t even bother to use that JS. I’ll copy a zoom join link from an invitation to send to someone, and I get some sh**y Google redirect URL.
I thought Gmail didn't support js execution. Did Google make an exception for themselves?
It’s not JS in the message. It’s the JS of the GMail page.
> The most obnoxious thing about this I think is that Chrome shows the original link.

Not defending Google here, but could it be that the tracking page is opened by onclick() while the browser shows the original href attribute?

I've seen some websites do that for various purposes and opening the link in a new tab (middle mouse click) usually bypasses it.

That sounds like a China problem, not Google.