We like to measure. With Google Analytics, we can easily measure many interactions between a user and a website. This is all well and good if your website produces nice clean URLs. For complex sites such as the Intranet Portal, it becomes much, much harder to interpret the results.

This post describes the steps taken to decipher site usage. If you’re not into JavaScript, look away now.


How to create meaningful web analytics output from a platform that has URLs in a particularly nasty format.

Default tab after login – this URL is just about manageable:

Another tab – this URL is fairly meaningless to most people:

We want to know what the user’s interactions with our Luminis portal are, but we need to rewrite the URLs into something vaguely intelligible.


Instead of using Google Analytics (GA) just to register page impressions, we use javascript to attach click/submit actions onto just about every interaction that a user can make with the Luminis portal.

We rewrite the URLs to something meaningful, e.g.

/tabs/My School
/channel/Library Online Catalogue/actionButton/undefined
/channel/WebCT/actionButton/Launch WebCT

We’re using jQuery fairly extensively with our Luminis (3.3) implementation, so it seems fair to use jQuery as a base to interact with GA.


I’m assuming a basic knowledge of jQuery and GA, but most of this is fairly straightforward anyway. I don’t rate my jQuery code as particularly elegant, but it does at least work.

Our Luminis implementation has some reasonably advanced customisations based on the nested-tables.xsl customization layer hack. We’ve removed a lot of the nested tables and the tabbed navigation uses unordered lists.

Our Google Analytics plugin for jQuery is loaded to evaluate the following:

  • clickEvents – translates a click event to a user readable “URL” to pass to GA
  • submitEvents manually added to the javascript – translates a submit event to a user readable “URL” to pass to GA
  • evalClickEvents manually added to the javascript, on click, a function is evaluated to chose what parameters to pass back to GA Register a click on a tab:
    "#menu li a": "'/tabs/'+ $(this).text()"

    Register an expansion of an accordion within a channel:
    ".accordionCluster li h3": "getNewsItemTitle( $(this) )"

    the function getNewsItemTitle() is evaluted and results passed back to GA
    Register a click on a link within a channel:
    ".channelContent a": "getChannelAnchor( $(this) )"

    N.B. evalClickEvents is required if you are sending $(this) through to a function as $(this) will not be defined, until the click event occur
  • evalSubmitEvents all form submit events within a channel are captured using the following :
    '.channelContent form':    "getChannelFormInfo( $(this) )"

    The title of the channel and the text on the submit button are passed back to GA

Google Analytics administration

Remove (almost) all page impressions with the following filters

In GA, go to Settings | Edit
and add some filters

Login Page (Search & Replace)
/media/uk/ac/nottingham/compass/layout/public/ rewrite to /loginPage

Default tab (URL translation)
^/cp/render.userLayoutRootNode.uP$ rewrite to /tabs/Default

Remove ^/cp/[.*] pages (Exclude)
Filter Field: Reuqest URI
Filter Pattern: ^/cp/[.*]

Remove /cp (Exclude)
Filter Field: Request URI
Filter Pattern: /cp

The finished “Profile Settings” page looks like this:


I’ll give these in a future post, but in an example week, we’ve registered 1.5 million ‘page impressions’ with around 36,000 daily logins.

An example of what tabs are used can be seen in the screen shot below:

I now need to take some time and interpret the results.

Related information