ServersSession Tracking With Apache Page 4

Session Tracking With Apache Page 4

ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.

Dynamic Solutions

If you are developing a dynamic site (i.e., using PHP, Perl, or Java), then the mod_usertrack module will not be very useful. This is because much of the site’s functionality may be embedded into the dynamic components. This can make the limited output mod_usertrack provides useless because the form elements and components are not stored in the logs.

Also, it’s highly likely that your dynamic solution may already be using some kind of user session tracking tool that can help provide the sought-after information. The fewer cookies supplied to a client, the less likely users will be over-conscious of the information stored, and will thus be more likely to use the site.

Table of Contents
Tracking Progress
Adding mod_usertrack to Your Apache Installation
Enabling Tracking
Choosing an Expiry Time
Configuring the Log
Analyzing the Results
Dynamic Solutions
The Performance Trade Off

How information is logged and tracked is entirely up to you, but for the most part it depends on the type of site created and how the information is monitored. For simple monitoring, we recommend a very simple log that generates simple sentences like this (obviously with each session ID appended to each line):

User searched for books with 'Apache' in the title
User viewed the book 'Pro Apache' User added the book 'Pro Apache' 
   to their basket
User viewed basket

Although simplistic, it has the benefit of being very readable, while not permitting easy summary processing. For example, when using this method it is difficult to see how many people searched for books with ‘Apache’ without doing some more extensive text processing. When that level of detail is needed, write the information to a database in a rigid format, like so:

Tracking More Data

SessionID Operation Parameter ID
98374 Search Apache  
98374 View   3475
98374 Buy   3475
98374 ViewBasket    

As the contents of this table illustrate, it would be possible to obtain the number of times a page for a particular book was viewed and the book was purchased, and how frequently various search terms were used. This is how, for example, is able to provide a user with ‘recommended’ titles.

The Performance Trade Off

Regardless of whether you use mod_usertrack or a system embedded into your dynamically driven site, there will be some performance trade offs. The trade off comes at a number of levels, but just the act of exchanging cookie data and looking up cookie information between browser requests is time consuming, not to mention the overhead of writing the information to a log file or database.

This will present an issue (if only a small one), however you look at it, and deciding whether to go ahead will rely entirely on how much value there is in the information and how much of a trade off you are willing to make between the value of that information and the effect on your site.

Generally, for dynamic sites, the extra information gained — especially if that information is used to help guide the user to other products or items he may be interested in — is significant. Most dynamic sites are already reading and writing to databases or files, so one more will not hurt.

Get the Free Newsletter!

Subscribe to Daily Tech Insider for top news, trends & analysis

Latest Posts

Related Stories