Hello all.
I have a bunch of links on my page and I want to know how many times people clicked on each of them. I'd like to hear your opinions what would be the best way considering user comfort, development difficulty, server load and robustness.
I thought of three possible ways:
1) Add an onclick event for each of the links that would send an AJAX request to a counter application on my server. Here, I don't know if the user would have to wait for the counter app's response in case it was slow.
2) Add an onclick event for each of the links that would store the information about which link was clicked to a cookie. The next time the use would hit the page, the information from the cookie would be collected. The downside I see is that so far, my page is static, which I consider a great advantage and I would have to give up on that.
3) Add a layer. The links would not really point to the sites themselves but rather to something like my.domain.com/hitcounter/URL, which would save the hit and redirect the user. This would definitely be easy to do but the user comfort would be most hindered.
What do you think?