in reply to Control link clicks
There is a very easy way. Just tell your users to write down the address whenever they click on a link, and have their sheets mailed to you monthly.
You haven't told us your setup, so it's kinda hard to suggest you a solution.
Potentially, you want to use just a simple redirector, except that such a redirector will be abused by people who want to anonymize their links:
First you need to rewrite all your outbound links so they go through your redirector:
<a href="/linkcounter?url=$link">Clicky clicky</a>
You will need to URL-escape $link using URI::Escape but I'm too lazy to look that up now, and then you need to reconfigure your webserver to serve the counter+redirector under the URL /linkcounter:
use strict; use CGI; my $cgi = CGI->new(); my $target = $cgi->param('url'); print "301 Elsewhere\r\n"; print "Location: $target\r\n"; print "\r\n";
If all of this was about monitoring what links a local user clicks, the easy ways are to install a proxy server through which the user operates or to monitor what the user does, for example through WWW::Mechanize::Firefox.
|
|---|