Steven Mileham – General Geekery

October 23, 2009

Google Analytics – Tracking page categories

Filed under: Technology — Tags: , , — smileham @ 2:30 pm

I’ve recently been looking at how I can use Google Analytics to track website usage of content based on the category it has been assigned.  We are using META tags in the page headings to store the category name and title of the content.

Google have just rolled out a bunch of excessively handy features allowing custom variables in their most recent update to the analytics package, unfortunetly my Analytics account hasn’t yet been updated to include them.  As a fall back I’ve used the Event Tracking functionality instead.

At the bottom of each page which I want to track the category of, added the following code;

  1.  
  2. <script type="text/javascript">
  3.   var pageTracker = _gat._getTracker("<%= googleAnalyticsId %>");
  4.  
  5.   function getMeta(name) {
  6.     var metas = document.getElementsByTagName(‘META’);
  7.     for (var i = 0; i < metas.length; i++){
  8.       if (metas[i].getAttribute(‘NAME’) == name){
  9.         return metas[i].getAttribute(‘CONTENT’);
  10.       }
  11.     }
  12.     return "null";
  13.   }
  14.  
  15.   try {
  16.     var cat = getMeta("CATEGORY");
  17.     var title = getMeta("ARTICLE_NAME");
  18.  
  19.     if(cat != "null" &amp;&amp; title != "null"){
  20.       pageTracker._trackEvent(‘Category’,cat,title);
  21.     }
  22.   }catch(ex){
  23.     /* do nothing */
  24.   }
  25.   pageTracker._trackPageview();
  26. </script>
  27.  

Using this codes means that I can put these meta tags into the headings of any page;

  1.  
  2. <meta name="CATEGORY" content="Analytics" />
  3. <meta name="ARTICLE_NAME" content="Custom Variables" />
  4.  

And Google Analytics will track the my each of my articles based on the category they have been tagged with.

February 26, 2009

The future of Google Chrome

Filed under: Technology — Tags: , , , , — smileham @ 6:14 pm

Google as a company just seem to get it, by introducing (yet) another browser into the wild, they began another round of the browser wars. Kicking off a flurry of innovation, which browser manages to render the acid tests? Who can perform the most javascript calls per milli-second? etc.

All Google seems to care about is that this innovation continues, so that they can build web applications to run on these platforms.

This interview is really worth a read to see the direction of Google and the Chrome browser.

Interview: what’s next for Google Chrome

Always the Google fan boy!

February 11, 2009

Google Mobile – Sync

Filed under: Technology — Tags: — smileham @ 1:18 pm

Google SyncSeeing as I am a Google fan boy and I love my iPhone, I was really pleased that Google finally got round to enabling sync with Google Calendar.

Previously I had been using Nueva Sync, a third party tool which acted as an Exchange server.

Now Google have produced their own service which can push updates to an Exchange enabled client.

Google Mobile – Sync.

September 3, 2008

Google Chrome

Filed under: Technology — Tags: , , , — smileham @ 12:54 am

It looks like the “Google Browser” finally landed.

Seeing as I am a Google fanboy, I’ve been waiting for this the second I heard it was happening.  The fact that they got Scott McCloud to create a 38 page comic detailing Chrome’s features adds bonus points!

From my perspective, the three most interesting features, in order of importance are;

 

  • Separate threads for each tab/plugin/window.
  • Javascript compiler
  • Open source
We’ve already seen what Firefox’s entry into the browser market has done to the “industry”, it’ll be interesting to see whether Google can shake it up any more.
There are a few things missing though, although they aren’t show-stoppers;
  • Ad blocker – Aparently there are adverts on the web, I wouldn’t know, seeing as I’ve been using Firefox with adblock plus since it was released.
  • Spell checker – I’m lost without this, where oh where are my red underlines?
So far though, I’m really looking forward to working with Chrome, it’s underlying engine is Webkit, which is also used by Safari.  Looks like Open Source cross pollination is the way forward!

 

Powered by WordPress