HACKER Q&A
📣 linkdd

Why Use an URL Shortener?


After reading about the `git.io` deprecation, I see that Github recommend using another URL shortener service.

But I'm wondering, why would you use such a service? I know Twitter and LinkedIn automatically shortens the URLs you post with a service they own that is completely integrated with their social network.

Twitter do this because the length of a tweet is limited. LinkedIn do this for tracking I guess?

But let's assume you're not Twitter or LinkedIn or any major social network. What are the pros to relying on such services?

The cons I see are:

  - hide the real website behind an URL
  - adds an extra redirection/DNS query
  - hard to remember URL based on a hash
Scientific papers referencing shortened URLs is pretty shocking to me for those reasons. But, I must just be missing the pros, right?


  👤 leros Accepted Answer ✓
Short links are useful for when you want a URL that you can share but change where it goes in the future.

Short link services will also let you redirect to different destinations based on rules. So you could split traffic 50/50, you could send European users to a different URL, etc.

Another valuable service is that they you let track clicks without having to add tracking code to the destination page, which means you don't have to modify the destination or even own it.

It's not really about link shortening, it's about dynamic redirects and tracking.

You could imagine a site having a URL for a game sale like "shortlink.com/gamesale" and right now a user in London would get sent to "gamestore.com/european-version-of-sale-page?tracking_param=may-2022"


👤 jbjbjbjb
It is often said that url shorteners can be used for cross site request forgery. I recently clicked on a link in a Twitter profile thinking it would take me to a homepage but instead it subscribed me to their YouTube channel.

But I’m not sure I agree with this view because no one is checking the url for every link they click on and there are good ways to defend against the attack.


👤 avallach
To make QR code that's easier to scan.

👤 SirChainsaw
The only two I can think of are tracking and rick-rolling.....but there must be more.