09 Dec 2004, 10:01
|
Marcus
Joined on 31 Oct 2004
Dublin, Ireland
Posts 19
|
Re: HTTP Module some help ?
|
|
|
The only way to track outbound click thru's is to replace all external links with proxy links...
The problem is that once an external link is sent to the client, you loose control over any navigation to that link.
There is a relatively easy way to do this on a global basis which involves filtering all HTML before it is sent to the client.
Here are some "top of the head" points to think about for the implemenation:
-
Create a SQL table called "ExternalLinks" or whatever...
- Create a stored procedure which returns a GUID for each unique link. Internally this SP searches the links table for the required link and returns it's GUID. If not found, it inserts a new row and returns the new GUID. Optimisations will be necessary here and you could add a link Hashcode to improve lookup speed.
-
Create a second stored porcedure which returns a link for a given GUID.
-
In the ASP.NET app, create a page called "ExternalLink.aspx" which takes a GUID as a QueryString parameter. In this page, call the link lookup SP with with the GUID param and perform a Redirect on the client. This is also where you log the click thru.
- In a HTTPModule, create a RegEx which matches all hyperlinks and run the regex against the outbound HTML
- For each match call the SP to get the link GUID
-
Replace matches with "" etc
Of course since the Links are static, making extensive use of the ASP.NET Cache will greatly improve performance and save you having to call multiple SP per page view...
I'm sure there are going to be a bunch of other optimisations necessary before this will perform in production, but hopefully this is a start...
Marcus
blog:
http://www.styledesign.biz/weblogs/macinnesm/
|
|
| |
|
|
|
|
|
|