Count times of clicking a link

There are some links about download some files.
How to write scripts to count how many times the files have been downloaded?