Building Traffic and User Reports

We've seen enough theory and justification for analyzing traffic on our site, so let's get on and look at how we do it in practice. We'll look at three areas of creating reports:

You've seen what some of these reports look like in the previous section of this chapter. Here, we'll look at the ASP code and other techniques that make them work. To give you some idea of the kinds of reports we offer, this is part of the menu that our own site administrators see:

This page (trafficreports.asp) is just a series of nested unordered lists, with each link including values in the query string that control which table is used to build the report, and which records are included in it. The following code is a section from this page. Notice that all the links reference the same file, showlog.asp:
...
<UL>
 <LI><B>Total Hits and Traffic Volume Listings</B></LI>
 <UL>
  <LI><B><A HREF="showlog.asp?query=day&site=all">Summarized by Day</A>
      for All Sites</B></LI>
  <UL>
   <LI>for only the <A HREF="showlog.asp?query=day&site=wd")%>">
       Web Developer</A> site,
       <A HREF="showlog.asp?query=day&site=cd")%>">COM Developer</A> site,
       <A HREF="showlog.asp?query=day&site=wa")%>">World Of ATL</A> site.</LI>
  </UL>
  <LI><B><A HREF="showlog.asp?query=hour&site=all">Summarized by Hour</A>
      for All Sites</B></LI>
  <UL>
   <LI>for only the <A HREF="showlog.asp?query=hour&site=wd")%>">
       Web Developer</A> site,
       <A HREF="showlog.asp?query=hour&site=cd")%>">COM Developer</A> site,
       <A HREF="showlog.asp?query=hour&site=wa")%>">World Of ATL</A> site.</LI>
  </UL>
 </UL>
</UL>
...

We've provided all the files you'll see in this chapter, along with the other samples for the book, on our Web site at http://webdev.wrox.co.uk/books/1797/.

© 1998 by Wrox Press. All rights reserved.