Does the banners get generated using remote javascript?
Some place make you use javascript that way they can track how many impressions they get etc. If this is the case then Im not sure how you can track the clicks and keep the impressions consistant.
If you do have the URL and the impressions part is not important - then you need to create a databse table with fields like - link_id, link_url, link_counter, time etc. then replace the link with a pointer to your php script that will receive the link from the database (using the link_id), update the time and counter then l jump to the selected URL. This is good to have as you can track as many links as you like throughout your site.
Cheers