Read Part 2
In Part 2 we looked at how to create the script that recorded the clickthrough and sent the user onto the appropriate URL. In this final part, we'll examine how to create a reporting page that lists how many each "trackable" hyperlink has received.
Creating a Reporting Page
For the "trackable" links application I really didn't need a super fancy reporting screen. The metric I was most interested in was the total number of clicks for each "trackable" hyperlink. I also wanted to be able to, for a given "trackable" hyperlink, be able to list each date/time the link was clicked. I created a simple page to display this information. Below you'll find the source code (and a live demo) for this reporting page:
In the report screen you'll see a "trackable" link
titled "Article Demo." This is an example of a "trackable" link I made for this article.
This "trackable" link points to
/demos/Tracked.asp but, to successfully track
the click, I must point the hyperlink to
/ASPScripts/Goto.asp?ID=3. Go ahead
notice that it increments the count in the report screen. Clicking on a Name for a particular "trackable" link lists the complete list of date/times
the particular link was clicked.
Note that, in the above code, a stored procedure,
sp_LinkReport is called and
passed an ID. If the ID is zero, the summary report is returned; if the ID is non-zero,
a list of clickthrough date/times for the "trackable" hyperlink represented by the ID are
returned. The contents of the
sp_LinkReport stored procedure can be seen