Our team has been discussing the need to track some external links. For example, on Czech wiki there is a prominent link in the top navigation to https://nastenka.wikimedia.cz/?source=cs.wikipedia-menu; we'd like to understand how first 24-hour users are utilizing this and other external resources.
Per the parent task, we'll have server-side logging of page views and redirects.
To track external links, we could either add client-side logging to links external links, or modify external links to use a redirect mechanism on wiki. For example, instead of linking to https://nastenka.wikimedia.cz/?source=cs.wikipedia-menu, we would link to https://cs.wikipedia.org/wiki/Special:Redirect/externalUrl/https://nastenka.wikimedia.cz/?source=cs.wikipedia-menu, and then the visit to Special:Redirect would get logged and the user would be sent to the external URL. This approach has the nice side effect of reducing the information sent to external domains about the page the user was just on (external sites would see Special:Redirect as the referer rather than whatever URL they were on before).
I have a proof of concept patch for the server-side Special:Redirect approach, but I am open to doing this client-side if we think that will be a better solution.