Is there a way you could just
<?php require('track.php'); ?>
from your header in all your webpages and just pass a superglobal to it with your href? Or is that not at all how your tracking script works?
I guess I would need to know how your tracking script works to get an idea of how to approach this.