Updated the code to be compatible with the Blacklight 5 onwards.  This now utilises the content_for :head method to add the Google analytics javascript to the application head.  Uses content_for_in_controllers gem to enable content_for to be used in the controller.
Fixed the defaults facets selector in the Javascript. .live() replaced with .on()
Google analytics tracking code updated with the latest version from Google