50

When I click on "Share" on a question or answer, a small block pops up and I receive a URL that I can copy and paste to other people. The popup also says:

share a link to this answer (includes your user id)

and the URL has the following structure:

  • https://stackoverflow.com/a/:answerId/:userId
  • https://stackoverflow.com/q/:questionId/:userId

I can remove the user ID and the links still work.

My question is why should I leave the user ID in the link? Do users receive something (reputation) in exchange? I don't really see the reason for attaching my user ID to the answers or questions I'd like to link to, so I'm wondering why it's even there.

6
  • 27
    See Other Badges: Announcer, Booster, Publicist.
    – honk
    Commented Mar 12, 2019 at 12:49
  • It could be used for (internal) analytics. All I know is that there's no reputation attached to that userId section.
    – Cerbrus
    Commented Mar 12, 2019 at 12:50
  • Very related How does the announcer badge (and similar badges) know who shared the link? (not duplicate because it doesn't address if there are any other uses for the id in the url).
    – ryanyuyu
    Commented Mar 12, 2019 at 12:55
  • 1
    Word-wide it's known as affilate links, allowing to identify poster. SO doesn't deanonimize them, so if you ever get the link - you can easily know thanks to whom (stackoverflow.com/users/1997232 - replace the number at the end).
    – Sinatr
    Commented Mar 12, 2019 at 15:19
  • I swear there's a duplicate on MSE.
    – iBug
    Commented Mar 12, 2019 at 15:28
  • Yes, the tracking part was clear to me. What wasn't is what I get in exchange for "leaking" my identity. I can get badges. Commented Mar 13, 2019 at 8:45

2 Answers 2

56

Pro: you might get a badge.

Con: your online identities might be linked to each other when you don't expect it. Example: sharing a link with a colleague can lead them to discover your Stack Exchange profile with questions about your work environment.

This issue was discussed in “Share” links deanonymize user unexpectedly where a global setting "do not include User Id in share links" was proposed. It has not happened yet, and perhaps never will, but meanwhile, the habit of deleting the second number from short links is a good one to develop. (A userscript can do that for you as well.)

4
  • 65
    Badges are more important than privacy! Commented Mar 12, 2019 at 15:39
  • 2
    Personal recommendation userscript: More Share Links (Markdown / HTML / BBCode)
    – Andrew T.
    Commented Mar 13, 2019 at 3:32
  • 1
    Can you edit your answer and leave a link to the Badges site and include in your answer the three badges you can get: Announcer, Booster, Publicist? Commented Mar 13, 2019 at 8:47
  • 1
    Could the user ID possibly be encoded in some way that it'll effectively hide the user ID. This would surely fix the issue of identification (note: I haven't yet read the Meta link MSOGA provided so it might've already been mentioned). It could possibly even be encoded with the question/answer ID (so the server can decode and separate the two) on a dedicated subdomain that will be processed by the server and then redirected to the target question/answer (like https://share.stackoverflow.com/dedg56yyhjcvy46v).
    – AStopher
    Commented Mar 13, 2019 at 18:35
21

As mentioned in the comments by @honk, it's related to how specific badges are awarded. If you don't have an interest in getting those badges, then you can remove your user ID that's added and still get folks to the appropriate answer or question.

Also, if you ever wanted to do a search to get all questions or answers you've handled, then it would be easier with the user ID included.

5
  • 1
    How would I search on Google for all the questions and answered that I shared online? Some kind of regex tricks should be supported by Google to achieve that, right? Commented Mar 13, 2019 at 8:49
  • Likely searching along your user id or all user ids would do it. Something like: site:stackoverflow.com (or whatever site/s) you want to search along with "your_stackoverflow_user_id" Commented Mar 13, 2019 at 14:56
  • Hmmm, I don't think that would work because I wouldn't be searching on stackoverflow, rather on other pages, e.g. on GitHub where I left a link to a stackoverflow issue in the comments, for example Commented Mar 13, 2019 at 15:46
  • Ahh, good point. I'm not sure then. Commented Mar 13, 2019 at 17:36
  • 6
    Query "allintext:stackoverflow.com user_id" should get some of them.
    – Frank
    Commented Mar 13, 2019 at 18:31

Not the answer you're looking for? Browse other questions tagged .