You'll have to make some sort of redirecting script.
meaning: when you print the link, you don't actually print the link, but you print a link to a script that will redirect the user to the real URL.
That script can then first update a counter or a database field to store the "click", and then it can send a redirect to let the user view the real URL.