alphagov/frontend — pull request #41 by jthoenes (2012-09-27 11:30:03+00:00)
Title: Proxy redirections to external sites

To track success of certain formats, we have to track exit links. In order to track them without degrading user experience we are now going through a proxy ExitController. This will only be used for links the datainsights platform is interested in (and therefore slug and need_id should exist) for tracking success.

The exit action will do:
- check the target link exists in the format (structure & markdown)
- send track success event from the server to Google Analytics
- render an HTML to redirect the user to the original target

Acknowlegding the concerns raised in the discussion at https://github.com/alphagov/frontend/commit/e92c72e36ae18ff76ba153bb721108966d00a24e:

- We are not sending people to any target link, because we want to avoid GOV.UK beeing used to redirect a user to dangerous sites (@JordanHatch, @bradleywright)
- As we are not tracking pages or formats without a need_id, a need_id will always be present. (@JordanHatch)