News for hackers. Stuff that matters.
Re:How not to do URL redirects (… the way Quora does) by avlesh-singh on Thursday January 19, 2012 @12:48PM (#3485614)
Tracking helps you build great analytics. I, as a developer, would have otherwise no idea of what's happening in my app.
Re:How not to do URL redirects (… the way Quora does) by MatthewPhillips on Thursday January 19, 2012 @01:02PM (#3485688)
Do it client-side. Don't break the web.
Re:How not to do URL redirects (… the way Quora does) by mwhooker on Thursday January 19, 2012 @04:05PM (#3486700)
Doing it client side has a couple issues.

1. you need to block the click event until you get a response from your analytics endpoint. Google suggests doing this by adding a 100ms delay: http://support.google.com/googleanalytics/bin/answer.py?hl=e...

2. you might get holes in your data for a number of reasons: the user has JS turned off; 100ms isn't long enough for the request to go through; or the user might click off before your script can attach itself to the onclick event.

You definitely don't want to get yourself in a situation where you go down and all outbound links stop working, but if you can fail gracefully, replacing the link makes a lot more sense.

Re:How not to do URL redirects (… the way Quora does) by lazerwalker on Thursday January 19, 2012 @05:44PM (#3487230)
Not to mention that your analytics code won't fire if the user opens a link by any means other than a standard left-click (e.g. middle-click, right-click -> open in new window/tab, or keyboard navigation)
Re:How not to do URL redirects (… the way Quora does) by drivebyacct2 on Thursday January 19, 2012 @05:11PM (#3487060)
Why does the delay matter? They have to wait for a response regardless of whether it's an AJAX request or a full browser redirect to the record/redirect URL.