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.
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.
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:
In your modules store, click on the icon for your comments form. This takes you to the form editor.
Go down to the bottom row of the form, and click on the edit button for the single cell on that line, which contains the submit button.
In the popup editing window, click on the cell content tool to 'Split merged cells'. This splits the row into three cells.
The new checkbox will go in the first two cells, in place of the submit button:
Click on the edit button for the first cell, which you'll find sitting just above the submit button.
In the popup window, select the cell tool to 'merge with cell on right', which will take you back to the form editor.
Find the edit button for the newly merged cell. Click on it to bring up the popup editor again.
In the popup editor, click on the top button labelled 'Change Cell Type'.
A new popup window shows you a list of cell type options, as pictured right (click thumbnail for larger version). Click on the option labelled 'Single checkbox', and click OK.
In the checkbox editor, enter some suitable text in the 'Label:' window, for example "Leave blank to publish your comment, check box to send it to us in private". To break it into two lines, put a return after the comma.
On the line underneath, click on 'change fieldname', and set a convenient fieldname, such as "private_"
Using the pulldown menus for horizontal and vertical alignment, set to 'Left align' and 'Middle align'.
Click OK to finish editing the cell.
Now create a new submit button in the final cell:
Click on the edit button for the third cell at the end of the row. Because this is an empty cell, the popup window automatically includes the same list of cell type options that you saw when editing the previous cell. Go down to the end of the list, select 'Submit button' and click OK.
Change the button text to "Submit your comment".
Set the alignment to 'Center align' and 'Middle align'.
Click OK to finish editing the cell.
Go to the top right-hand corner of the form editing screen and click the 'save and publish' button.
Now go straight on to add the new field to your database:
Back in your modules store, click on the icon for the comments database. Then click on the 'connections' tab in the database editor.
At the bottom of the connections screen, you'll find an option to 'select new module'. Click on it, and click OK on the alert popup.
You'll see a screen showing all the suitable modules in your module store. Click on the icon for the form you just changed.
If you go back to the 'connections' screen, you'll now see that the "private_" field you just added to the form has been added to the database, and is connected to the form.
Go to the top right-hand corner and click the 'save and publish' button.
Your form will now write the contents of the new field to the database whenever anybody adds a comment. Note that it's important to change the database straight after altering the form, as until you've updated the database, the form will encounter an error if it tries to write to the new field.
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):
In your modules store, click on the icon for the database query that connects to the reporter module.
You'll see that Xara has already added the new field, with a pulldown menu that's currently set to 'ignore'. Change this setting to 'no'.
Now go to the top right-hand corner and click 'save and publish' to finish
If your comments database already has some comments in it, the new field will be blank for all those records. Unfortunately, the query won't recognize those blanks as a 'no' (nor for that matter as a 'yes'). So if you still want them to be published, the final step is to edit those records in the database:
In your modules store, click on the icon for the database.
Click on the button to 'view all records'. This takes you to a screen showing each record in turn, with an 'edit' and 'delete' option to the far left of each one.
To modify any record, select 'edit'. This takes you to an 'Edit Record' screen:
Click on the "private_" checkbox once to set this field to "yes".
Click on it again to remove the check. This sets it to "no".
Click on the 'update record' button to save the change
Repeat for any other records you need to modify.
Changes you make in the database editor are written directly to the database, so once you've finished, click on the 'cancel' button at the top of the screen to return to the modules store.
If you already have a lot of public comments in the database, or if the comments function is already being heavily used, you may find it preferable to add the new field to the database first, update the database records next, and finish by changing the form and the query.
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.