Sponsored links:
There are many reasons for analyzing traffic to your website: among them, finding out which sites are sending you traffic, which pages visitors have viewed and in what order, and where they've gone on to. This can be done by analyzing server logs, but if a site is spread across multiple servers, or has some of its pages provided by third-party services, it's more realistic to use a hosted service. Loosely Coupled uses HitBox Professional, which starts at $24.95 a month for up to 25,000 monthly pageviews, and scales up to enterprise levels. Here are a few tips when setting up HitBox with a weblog publishing tool like Blogger.
The way HitBox works is it supplies some JavaScript code that you embed in each of your web pages. The JavaScript then takes care of forwarding all the relevant information to the HitBox servers every time a visitor lands on a page. All you have to do is paste the code into your pages or page templates. The trick is choosing where and how to do that. That will depend on how you want to analyze the information about which parts of your site people have been visiting.
HitBox allows you to track traffic to individual page names, and also to group them into content categories. The categories option is useful if your site has several separate sections for instance, articles as well as a weblog and you want to be able to track how the traffic splits between the two without having to total up figures for all the individual pages. The only trouble I find with categories is that once you've chosen a category name, you have to stay with it, as HitBox doesn't have a facility to rename them retrospectively (ie for pageviews already stored in its database). So if you change your category name from, say "/weblog" to "/blog", you can't consolidate the two categories together to analyse historic trends across the two periods. This affects your page traffic history statistics as well, since HitBox treats pages with a different category name as separate pages. On the other hand, that's a good thing if you've got pages with the same filenames in different parts of your site, as using categories is how HitBox distinguishes between the two.
For the page name itself, you can either allocate a specific name to each page within the JavaScript, or you can leave it defined as "PUT+PAGE+NAME+HERE" in which case it will automatically use the actual filename of the page. The latter is what you have to do for Blogger, since Blogger will use the same HitBox code in your template to create every page, so reading the filename is the only way to get separate counts for each of your individual archive pages. Note that, if your main weblog page happens to be the default page for the site or the directory (eg it's the index.html page), then HitBox also needs you to change the 'default page name' field in the JavaScript from "title" to "index.html" (or whatever your default page is called).
All of this means you can't rely on the downloadable wizard that HitBox supplies to generate the JavaScript for your pages. But it's easy to make these changes to the standard script supplied. Do remember to edit the category and page name fields in the 'noscript' section at the end of the code, as well as in the variable definitions at the beginning.
The other thing to bear in mind is that HitBox's authors update their JavaScript code from time to time, so to make sure you can take advantage of the latest features, you will need to update your page templates with the new code every so often. The 'Edit Account' option under 'Site Tools and Reporting' contains ready-made JavaScript for your account that is always up-to-date. I prefer to get my JavaScript from here anyway, so that I can use the reduced-size code that omits support for JavaScript 1.0.
The need to occasionally upgrade your JavaScript is another good reason why it's better to name pages by filename rather than naming them manually, since you can then make use of templates and includes to add the code to groups of pages in a single pass. However this means you need to make a habit of placing the code in an include that falls within the content area of your page layout, and not in an area that is part of the site-wide include skins. For Loosely Coupled, I put it in the right-hand sidebar. Another possibility would be to put it right at the beginning of the body, after the head information for each page.
If you're using JavaScript in your Blogger template, you'll find you can't edit the template in Blogger, because it has a habit of choking on the "&" characters in the JavaScript. Instead, you have to keep a separate copy of the template somewhere else, and edit the copy whenever you need to make changes. Then just delete the existing template in Blogger and paste in the edited copy when you're ready to go live with the changes.
One thing that HitBox doesn't do, but which would be very useful, is to make referrer information for individual pages available as an RSS or JavaScript feed, which could then be automatically republished on the site. By not doing so, HitBox hands an important advantage to non-hosted alternatives. It's a shortcoming that ought to be addressed.
Some visitors may want to comment in private, rather than having their remarks instantly published online, as shown in the previous step in this series. You can give them the choice by adding a simple checkbox to your comments form. Adding new fields to your form and database is a simple process using Xara Modules. Then all that's required is a small change to the query module to make sure comments marked as private won't be published to the site.
The first step is to add the new field to your form, and then copy the changes to your database:
Now you need to change the query module so that it filters out any private comments before sending them to the reporter module for publication (remember that, until you make this change, comments marked as private will still be published):
When doing a lot of database changes, it's also a good idea to temporarily switch off the option in the query module to execute every time the data changes, and turn it back on when you've finished your editing. Alternatively, you could create a form and query combination to globally update the records in the database but that's a more advanced step that we'll save for a later date.
Building a website using plug-in online services: the Loosely Coupled experience
Copyright © 2002-2006, Procullux Media Ltd. All Rights Reserved.