Technology Tales

Adventures & experiences in contemporary technology

Self-hosted web analytics tracking

24th April 2009

It amazes me now to think how little tracking I used to do on my various web “experiments” only a few short years ago. However, there was a time when a mere web counter, perhaps displayed on web pages themselves, was enough to yield some level of satisfaction, or dissatisfaction in many a case. Things have come a long way since then and we now seem to have analytics packages all around us. In fact, we don’t even have to dig into our pockets to get our hands on the means to peruse this sort of information either.

At this point, I need to admit that I am known to make use of a few simultaneously but thoughts about reducing their number are coming to mind but there’ll be more on that later. Given that this site is hosted using WordPress software, it should come as no surprise that Automattic’s own plugin has been set into action to see how things are going. The main focus is on the total number of visits by day, week and month with a breakdown showing what pages are doing well as well as an indication of how people came to the site and what links they followed while there. Don’t go expecting details of your visitors like the software that they are using and the country where they are accessing the site with this minimalist option and satisfaction should head your way.

There is next to no way of discussing the subject of website analytics without mentioning Google’s comprehensive offering in the area. You have to admit that it’s comprehensive with perhaps the only bugbear being the lack of live tracking. That need has been addressed very effectively by Woopra, even if its WordPress plugin will not work with IE6. Otherwise, you need the desktop application (being written in Java, it’s a cross-platform affair and I have had it going in both Windows and Linux) but that works well too. Apart maybe from the lack of campaigns, Woopra supplies as good as all of the information that its main competitor provides. It certainly doe what I would need from it.

However, while they can be free as in beer, there are a some costs associated with using using external services like Google Analytics and Woopra. Their means of tracking your web pages for you is by executing a piece of JavaScript that needs to be added to every page. If you have everything set to use a common header or footer page, that shouldn’t be too laborious and there are plugins for publishing platforms like WordPress too. This way of working means that if anyone has JavaScript disabled or decides not to enable JavaScript for the requisite hosts while using the NoScript extension with Firefox, then your numbers are scuppered. Saying that, the same concerns probably any JavaScript code that you may want to execute but there’s another cost again: the calls to external websites can, even with the best attention in the world, slow down the loading of your own pages. Not only is additional JavaScript being run but there also is the latency caused by servers having to communicate across the web.

A self-hosted analytics package would avoid the latter and I found one recently through Lifehacker. Amazingly, it has been around for a while and I hadn’t known about it but I can’t say that I was actively looking for it either. Piwik, formerly known as PHPMyVisites, is the name of my discovery and it seems not too immature either. In fact, I’d venture that it does next to everything that Google Analytics does. While I’d prefer that it used PHP, JavaScript is its means of tracking web pages too. Nevertheless, page loading is still faster than with Google Analytics and/or Woopra and Firefox/NoScript users would only have to allow JavaScript for one site too. If you have had experience with installing PHP/MySQL powered publishing platforms like WordPress, Textpattern and such like, then putting Piwik in place is no ordeal. You may find yourself changing folder access but uploading of the required files, the specification of database credentials and adding an administration user is all fairly standard stuff. I have the thing tracking this edifice as well as my outdoor activities (hillwalking/cycling/photography) web presence and I cannot say that I have any complaints so we’ll see how it goes from here.

Ubuntu upgrades: do a clean installation or use Update Manager?

9th April 2009

Part of some recent “fooling” brought on by the investigation of what turned out to be a duff DVD writer was a fresh installation of Ubuntu 8.10 on my main home PC. It might have brought on a certain amount of upheaval but it was nowhere near as severe as that following the same sort of thing with a Windows system. A few hours was all that was needed but the question as to whether it is better to do an upgrade every time a new Ubuntu release is unleashed on the world or to go for a complete virgin installation instead. With Ubuntu 9.04 in the offing, that question takes on a more immediate significance than it otherwise might do.

Various tricks make the whole reinstallation idea more palatable. For instance, many years of Windows usage have taught me the benefits of separating system and user files. The result is that my home directory lives on a different disk to my operating system files. Add to that the experience of being able to reuse that home drive across different Linux distros and even swapping from one distro to another becomes feasible. From various changes to my secondary machine, I can vouch that this works for Ubuntu, Fedora and Debian; the latter is what currently powers the said PC. You might have to user superuser powers to attend to ownership and access issues but the portability is certainly there and it applies anything kept on other disks too.

Naturally, there’s always the possibility of losing programs that you have had installed but losing the clutter can be liberating too. However, assembling a script made up up of one of more apt-get install commands can allow you to get many things back at a stroke. For example, I have a test web server (Apache/MySQL/PHP/Perl) set up so this would be how I’d get everything back in place before beginning further configuration. It might be no bad idea to back up your collection of software sources either; I have yet to add all of the ones that I have been using back into Synaptic. Then there are closed source packages such as VirtualBox (yes, I know that there is an open source edition) and Adobe Reader. After reinstating the former, all my virtual machines were available for me to use again without further ado. Restoring the latter allowed me to grab version 9.1 (probably more secure anyway) and it inveigles itself into Firefox now too so the number of times that I need to go through the download shuffle before seeing the contents of a PDF are much reduced, though not completely eliminated by the Windows-like ability to see a PDF loaded in a browser tab. Moving from software to hardware for a moment, it looks like any bespoke actions such as my activating an Epson Perfection 4490 Photo scanner need to be repeated but that was all that I needed to do. Getting things back into order is not so bad but you need to allow a modicum of time for this.

What I have discussed so far are what might be categorised as the common or garden aspects of a clean installation but I have seen some behaviours that make me wonder if the usual Ubuntu upgrade path is sufficiently complete in its refresh of your system. The counterpoint to all of this is that I may not have been looking for some of these things before now. That may apply to my noticing that DSLR support seems to be better with my Canon and Pentax cameras both being picked up and mounted for me as soon as they are connected to a PC, the caveat being that they are themselves powered on for this to happen. Another surprise that may be new is that the BBC iPlayer’s Listen Again works without further work from the user, a very useful development. It very clearly wasn’t that way before I carried out the invasive means. My previous tweaking might have prevented the in situ upgrade from doing its thing but I do see the point of not upsetting people’s systems with an overly aggressive update process, even if it means that some advances do not make themselves known.

So what’s my answer regarding which way to go once Ubuntu Jaunty Jackalope appears? For sake of avoiding initial disruption, I’d be inclined to go down the Update Manager route first while reserving the right to do a fresh installation later on. All in all, I am left with the gut feeling is that the jury is still out on this one.

Navigation shortcuts

12th March 2009

I may have been slow off the mark on this but I recently discovered keyboard equivalents to browser and forward buttons. They are: Alt+[Let Arrow] for back and Alt+[Right Arrow] for forward. I may have first discovered their existence in Firefox but they seem to be more widely available than that with the same trickery working in Chrome and Internet Explorer having them too. The existence of these keyboard shortcuts might provide some pause for thought too for those web application developers who plan on disabling the Back and Forward functionality in browsers but being able to save mouse mileage with keyboard can’t be bad.

Trying out Songbird

2nd March 2009

Songbird

It’s amazing what can be done with a code base: the Gecko core of Firefox has been morphed into a music player called Songbird. On my Ubuntu machine, Rhythmbox has been my audio player of choice, yet the newcomer could be set to replace it. There might have been other things going on my system, but Rhythmbox playback was becoming jumpy and that allowed me a free hand to look at an alternative.

A trip to the Ubuntu repositories using Synaptic was all that was required to get Songbird installed. I suspect that I could have gone for an independent installation but the one that was available through the official channel sufficed for me. It found every piece of music in the relevant folder, even those that it was unable to play because of iTunes DRM and it was easy to set it such that it simply moved on when it met such a file rather than issuing a dialogue box to complain. That means that I weed out the incompatible entries in the course of time rather than having to do it straight away. I cannot claim to be an audiophile, but the quality of the playback seems more than acceptable to me and there seem to be no jumps so long as a file hasn’t been corrupted in any way. All in all, Rhythmbox could get usurped.

A CSS3 resource

30th September 2008

While you could go over to the W3C and peruse its documentation, it’s always nice to see information being presented in a more user friendly way than dry specification documents. I know that CSS2.x adoption is still bumping along -- IE comes to mind as a laggard -- but CSS3 has some nice additions that I could use. One of these is border rounding, which is supported after a fashion by Firefox, Safari and Chrome (a very nice browser, even at this very early stage in its development; it’s Windows only for now so try out CrossOver Chromium if your OS preference is Linux or OS X). It would be very nice if CSS3 support was more advanced but that’s not how things are right now. Therefore, seeing a website like CSS3.Info with its latest CSS3 news and its previews, browser CSS selector testing among other things is a definite bonus.

position: static?

12th September 2008

CSS positioning seems to be becoming a nightmare when it comes to IE6 support. While I am aware that the likes of 37signals have stopped making their products work with it, there remain a lot of people who stick or are stuck with the old retainer. I am one of the latter because of the continued use of Windows 2000 at my place of work, though a Windows Vista roll-out has been mooted for a while now. If nothing else, it keeps me in the loop for any inconsistencies that afflict the display of my websites. Positioning of an element within the browser window rather than within its parent element is one of these and it looks as if specifying a position of relative in a stylesheet is part of this. Apparently, it could be down to its non-triggering of IE’s haslayout property. It might be a hack but I have found that static positioning has helped. I’ll continue to keep my eye out for a better solution if it exists but the static option seems to have no detrimental effect in IE7, IE8, Firefox, Safari, Chrome or Opera.

A first look at Ubuntu 8.10

20th July 2008

I must admit that my curiosity got the better of me when screenshots of Ubuntu’s 8.10, otherwise known as Intrepid Ibex, started to make their appearance. It is only at alpha2 stage so it’s definitely a no-no for production systems. However, it does run surprisingly smoothly even at this stage. Yes, I have seen rough edges and the biggest of them all has made me install it onto my spare PC; there is certainly tendency for systems to hang when you try running 8.10 in virtual machines, my preferred method for these kinds of explorations. Try it in VirtualBox and kernel panic messages ensue while you can log in on VMware Workstation only for the desktop never to load. Those could be major deficiencies for some but they have both been reported with the former being seen by many and the latter being flagged by my own self.

Because I was using a version with the alternate installer, the usual slickness that we expect of Ubuntu installations wasn’t apparent. I am sure that will change in time for the final release but I didn’t find it too taxing to get things going with this means. Nevertheless, I reckon that we will see the usual feel return in later development versions and very much in time for the final release. Because I was installing over the top of a previous Ubuntu installation, I didn’t want to lose everything but I needed to leave it wipe out the previous root system partition for it to continue without freezing. Because my home area is on a separate partition, there was no problem and it picked up settings like desktop backgrounds without a fuss. One thing that might annoy some is that all this takes manual intervention; you don’t get the sort of non-destructive and seamless upgrade capability that openSUSE 11 gives.

What you get when the installation is completed is a Linux desktop that won’t look too different from what we are used to using. Of course, we get the New Human theme with its tasteful chocolate tones in place of the previous default orangey browns. They need to sort out a bug (another of my reports)  where black text is being displayed on dark backgrounds on the default display of drop down menus in Firefox and maybe look into why changing the level of enhancements from Compiz Fusion messes up the display of the workspace switcher in the task bar but it’s fine apart from this.

Otherwise, it’s a case of steady as she goes with OpenOffice 2.4, Firefox 3 and so on. That may change as time goes on OpenOffice 3 looming in the horizon. For some, all this continuity is all well and good but I could foresee comments front some parts that nothing dramatic is happening and that Ubuntu cannot afford to stand still with the advances of Fedora, openSUSE, Mandriva and so on. Saying that, I personally like the continuity because it doesn’t mean that my apple cart is going to get overthrown now and again. Indeed, you could say that the whole Linux distribution market has matured very nicely with evolution being the order of the day and I suppose that Ubuntu needs to be seen to be evolving more than perhaps it has been doing.

In summary, it’s early days for Intrepid Ibex but it works well even at this stage. In fact, it is running sufficiently so that I am writing this very post in a Firefox session running on the thing.  It’ll be interesting to see how it goes from here and if any more pleasant surprises are visited upon us. After the “safety first” approach of Hardy Heron, I suppose that Canonical can feel a little more adventurous so we’ll see what comes. In the meantime, Here are a few screenshots below for your perusal:

A case of “peekaboo” behaviour in Internet Explorer

1st July 2008

Recently, I changed the engine of my online photo gallery to a speedier PHP/MySQL-based affair from its PHP/Perl/XML-powered predecessor. On the server side, all was well, but a peculiar display issue turned up in Internet Explorer (6, 7 & 8 were afflicted by this behaviour) where photo caption text on the thumbnail gallery pages was being displayed erratically.

As far as I can gather, the trigger for the behaviour was that the thumbnail block was placed within a DIV floated using CSS that touched another DIV that cleared the floating behaviour. I use a table to hold the images and their associated captions in place. Furthermore, each caption was also a hyperlink nested within a set of P tags.

The remedy was to set the CSS Display property for the affected XHTML tag to a value of “inline-block”. Within a DIV, TABLE, TR, TD, P and A tag hierarchy, finding the right tag where the CSS property in question has the desired effect took some doing. As it happened, it was the tag set, that for the hyperlink, at the bottom of the stack that needed the fix.

Of course, it’s all very fine fixing something for one browser but it’s worthless if it breaks the presentation in other browsers. In that vein, I did some testing in Opera, Firefox, Seamonkey and Safari to check if all was well and it was. There may be older browsers, like versions of IE prior to 6, where things don’t appear as intended but I get the impression from my visitor statistics that the newer variants hold sway anyway. All in all, it was a useful lesson learnt and that’s never a bad thing.

An option for when BBC’s iPlayer will not allow you to “Listen Again”

14th June 2008

Following my move to Firefox 3, the BBC’s iPlayer became problematical again. I eventually sorted it after a fashion but I am noting an option for the frustrated before talking more about that. Finding the links to the ram files for the BBC’s Listen Again service can be a nightmare because of the Beeb’s reliance on JavaScript to cloak things up so it’s useful to find somewhere where things have been deconvoluted for us. That’s The Beebotron. It’s really meant for users of the mobile internet but it serves well for those times when a mismatch between Firefox and RealPlayer on Linux derails the more usual way to do things.

Better font display in Firefox 3 on Ubuntu

12th June 2008

Now that all bar one of the Firefox plugins that I use have been updated to work with it, I have finally jumped ship to 3 from 2.0.x. The move wasn’t without its travails, though. For one thing, Google Toolbar stopped working and I resorted to Googlebar Lite instead for my needs. Apart from that, the only other irritation has been the appearance of fonts in the new version.

In Firefox 2, it would seem that I was geting away without tweaking my system settings to be their most optimum. With 3, I could do that no longer because of an irritating and pervasive fuzziness that particularly afflicted k’s and w’s. The way out of this turned out to involve changing my Appearance Preferences (Preferences > Appearance from the System menu). The required attention was focussed on the Fonts tab whereupon the Details button was brought into use.

Appearance Preferences

In the resulting dialogue box, smoothing was set to "Subpixel (LCDs)" and hinting to "Slight". Closing down everything after making the required selections and a restart of Firefox was all that was needed to improve matters and more completely make myself at home with Firefox 3.

Font Rendering Details

  • All the views that you find expressed on here in postings and articles are mine alone and not those of any organisation with which I have any association, through work or otherwise. As regards editorial policy, whatever appears here is entirely of my own choice and not that of any other person or organisation.

  • Please note that everything you find here is copyrighted material. The content may be available to read without charge and without advertising but it is not to be reproduced without attribution. As it happens, a number of the images are sourced from stock libraries like iStockPhoto so they certainly are not for abstraction.

  • With regards to any comments left on the site, I expect them to be civil in tone of voice and reserve the right to reject any that are either inappropriate or irrelevant. Comment review is subject to automated processing as well as manual inspection but whatever is said is the sole responsibility of the individual contributor.