English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

3 answers

If your web analytics tracking utility does not handle it (it should with php, html files, etc), or you are also trying to track outgoing link clicks, file downloads, etc, see below:

Yes you could do it with javascript. An awesome way is with AJAX. So onclick you would call a javascript function, that initiates an AJAX call to a server side script. This server side script would increment your database field count (for every click). Then you could return something back, or not.

If you have Google Analytics tracking on your website, you can add custom javascript onclick handlers such as:
onclick="javascript:urchinTracker('/outgoing/links/name_of_link');
and then inside of your navigation reports in analytics, you'll see the "outgoing" folder/link followed by "links", etc. Then there will be a click number associated with it, for the date range selected.

2006-09-14 10:21:01 · answer #1 · answered by clievers 4 · 0 0

The easiest way, and the way most professional ad programs work (Google Ad-words, Yahoo's thing, etc.) is to instead of directing the user that clicks on the link direct to the page, it instead goes to an intermediary page that does a redirect. This way you can keep all of the links in your db, keep a count field, and just supply your client's page a link with a reference to an ID instead of direct to the article.

Ex:

link= redirect.php?artId=1234

db has:

ID - 1234
article - cnn.com/some story/
count - 4

redirect.php just needs to read this artId, find it in the db, if found, increment the count and do a header("Location: "...) call.

2006-09-14 17:21:35 · answer #2 · answered by John J 6 · 0 0

any web stats program can tell you how many times "link1.html" has been clicked. It is all based on your server logs. Most ISP's offer at least a "lite" version of a server log reporting tool. Yahoo has a great one that I use.

Now to be a bit tricky, when I run an auction on eBay I use an image stored on one of my servers. I can then look at the server logs to see how many times the image was viewed, and by what IPA address. It gives me a great view of what is happening vs a standard counter.

hope that helps

2006-09-14 17:20:57 · answer #3 · answered by fwiiw 4 · 0 0

fedest.com, questions and answers