Link module - obtain details and count of link clicks

This is a forum to suggest new features for mojoPortal. 

This thread is closed to new posts. You must sign in to post in the forums.
4/24/2007 7:15:10 PM
Gravatar
Total Posts 2

Link module - obtain details and count of link clicks

Thanks for the great product!

I have a link on my web site to a commercial web site as a courtesy. I'm wondering if there is any way I can tell the number of times people click on that link. I guess it could be an enhancement to the Links module where this could be turned on for a link and the total could be updated in the database. Where would the reporting mechanism go? Site Statistics?

But it might also be nice to know where the requests came from (IP address). Maybe I'll just create a standalone web page outside of mojoPortal that redirects to the commercial site. If I change the link to go there, the IIS log files should show the details about the request (I think).

What if the Links module did this redirect instead of a page outside of mojoPortal. If the URL contained the external link, I think the log file would show it. Then I could just analyze the log files to extract the details.

4/24/2007 10:20:06 PM
Gravatar
Total Posts 2

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.

You must sign in to post in the forums. This thread is closed to new posts.