Re: Link module - obtain details and count of link clicks
I'm not a very experienced ASP.NET developer, but here is my simple solution. I created a Redirect.aspx page and placed in the top level folder:
<html>
<script language="C#" runat="server">
void Page_Load(object sender, EventArgs e)
{
string url = Request["tourl"];
if (url != null && url.Trim().Length != 0)
Response.Redirect(url);
}
</script>
<body>
<p>This page failed to redirect to the target URL.</p>
<form action="Redirect.aspx" runat=server></form>
</body>
</html>
I changed the link I want to track to "/Redirect.aspx?tourl=<target-url>" and now with web logging on, the log files will shows the details about the request generated from the link.
2007-04-25 02:57:32 192.168.1.10 GET /Redirect.aspx tourl=http://www.somedomain.com/ 80 ...
The Links module could be enhanced to have a new "Redirect" checkbox that changes the link to go through the redirect page. To make it even easier to obtain the details, would it make sense to have the relevent information logged to a specific file/table instead of relying on the web server log files.