r/web_programming • • Nov 23 '16

Question: When I click on links within reddit, the url shows "out.reddit.com/[url here] briefly before taking me to my website. What is happening during this moment?

I work in IT but not in the programming world, nor web stuff. As I can figure, this is some kind of tracking mechanism that is reporting that either anonymously or directly report on the outflow traffic.

I'm assuming that metric is how Reddit makes it's money? I'm not quite sure what else would be happening other than that.

Can somebody confirm or explain what's happening otherwise? I figured this would be a good community to ask. Thanks!

5 Upvotes

2 comments sorted by

1

u/EyeBluNCider Nov 23 '16

So to break it down from a programming perspective, they just have an event handler (which looks for a specific event, in this case an outbound link click), that collects data from the user link, the user itself, and the subreddit that they are clicking from. This event gets registered on the backend of the Reddit servers.

Here is some example code that Google Analytics uses, but the code that Reddit is using is much more complicated I'm sure, as it's customized to their needs.

 function handleOutboundLinkClicks(event) {
  ga('send', 'event', {
eventCategory: 'Outbound Link',
eventAction: 'click',
eventLabel: event.target.href,
transport: 'beacon'
  });
}

This was a recent implementation (the last 8 months or so), /u/umbrae sheds some light on this in the reddit thread linked below. The things that they are looking for mainly are:

  1. Vote speed calculation: It's interesting to think about the delta between when a user clicks on a link and when they vote on it. (For example, an article vs an image). Previously we wouldn't have a good way of knowing how this happens. 2. Spam: We'll be able to track the impact of spammed links much better, and long term potentially put in some last-mile defenses against people clicking through to spam. 3. General stats, like click to vote ratio: How often are articles read vs voted upon? Are some articles voted on more than they are actually read? Why?

https://www.reddit.com/r/changelog/comments/49jjb7/reddit_change_click_events_on_outbound_links/?ref=share&ref_source=link

1

u/OpenBookExam Nov 23 '16

Thanks very much for this. Very informative.