Category: Football

At my current company we needed a way to track links to downloads or external sites, so they would be logged in Google Analytics. I came up with this piece of code that will allow us to do so, the only prerequisite being at jQuery exists and is used on a particular website.

Here is the code:

<script type="text/javascript">
if (typeof(jQuery) != 'undefined') {
    jQuery(document).ready(function() {
        jQuery(".googleTrack").click(function() {
            var link_href = jQuery(this).attr("href");
			return true;

function trackGoogleClick(link_href)
    if(typeof(window.pageTracker) !== 'undefined') {
        pageTracker._trackPageview('tracked/-/' + link_href);
    } else if (typeof(window._gaq) !== 'undefined') {
		_gaq.push(['_trackPageview', link_href]);

To track a link (or any element for that matter) this method just give the anchor a class or “googleTrack”, and that’s it, it will be tracked.

Earlier this year I got injured pretty innocuously while playing football – the ball got played over the top of the opposition defence, I was through on goal with only the on-rushing keeper to beat. The ball bouncing quite high and I stretched my leg as high into the air as high possible (ie not very high at all), failing to make contact with it as the keeper took an easy catch.  I then planted my foot, with my leg completely straight and my momentum taking me forward. My knee was pushed inversely – with my leg trying to bend in the opposite way it was meant to. I’d hyper-extended it. I knew straight away something was wrong, subbed myself and haven’t played since. Initial diagnosis was that I had torn my meniscus (the cartiliage in my knee), however after taking part in physiotherapy this was not the case. View full article »