How do I keep track of how many times an external link is clicked?

狂风中的少年 提交于 2019-12-22 23:19:30

问题


I have a site affiliated with a university and we want to link to another site that has a certain teaching program.

How can we track the number of times this link has been clicked from within our website?


回答1:


I would use jquery and/or ajax to touch a page in the background (ajax) that counts hits whenever a link is clicked and then proceed to allow the link do what it does.




回答2:


You can use web analytics tools such as Google Analytics or commercial software such as WebTrends.




回答3:


Instead of directly providing the external link, link to a page on your own site that redirects to the link, and it will be logged like every other request.




回答4:


The sky is really the limit when it comes to link tracking. It really depends on your expertise.

You can use a service like bit.ly to track the clicks on the link. Bit.ly is mostly used a s shortner service, but if you sign up for bit.ly (actually make an account) You can keep track on the links that you generate and how much they are clicked.

If you want to install something on your server to track the links you can use something like: http://www.phpjunkyard.com/php-click-counter.php Its a simple redirect script that where you give it a link, and it will give you back a link that it can track. It keeps track of all the click. This script is super simple and does not require you to use a mysql database and you don't have to have a huge knowledge of programming to install it.




回答5:


Most reliable method is using a redirector to measure the traffic going through, no need for JavaScript (e.g. the phpjunkyard.com link given) as long as you can rely on your server to redirect without problems.

If a server side option is not available, using a web-analytics tool simply to count link clicks doesn't make sense, so the JavaScript option could be used, but you still need something to count the clicks in to.

If you would like to us a web-analytics tool to e.g. better understand your visitors, it's a different story; All (not all require it, but all use it if possible) the WA tools use a 1x1 pixel GIF to record calls and read the incoming data. GA is free, but you would have to code the link click (simple though). Piwik hosting is available really cheap and would do the trick. WebTrends and other tools are way too hardcore for this kind of requirement.



来源:https://stackoverflow.com/questions/4673457/how-do-i-keep-track-of-how-many-times-an-external-link-is-clicked

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!