In order to track the exit page for your web statistics you will just link to another forwarding page on your server and track the usage of that page. That's how it's generally done.
Alternatively, if you might consider using Google Analytics check this code:
<script>
/**
* Function that tracks a click on an outbound link in Google Analytics.
* This function takes a valid URL string as an argument, and uses that
* URL string as the event label.
*/
var trackOutboundLink = function(url) {
ga('send', 'event', 'outbound', 'click', url, {'hitCallback':
function () {
document.location = url;
}
});
}
</script>
Usage:
<a href="http://www.example.com"
onclick="trackOutboundLink('http://www.example.com'); return false;">
Check out example.com
</a>
The code above was copied from this page and from here: Google Analytics Outbound Link Event Tracking