From cdbfac116688c502618ac69a60c24c1e168d1ffa Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Sat, 17 Nov 2012 12:19:15 +0100 Subject: [PATCH] Add google analytics --- assets/scripts/app/routes.coffee | 8 ++++++++ public/index.html | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/assets/scripts/app/routes.coffee b/assets/scripts/app/routes.coffee index 7172aa63..f7c9ff5c 100644 --- a/assets/scripts/app/routes.coffee +++ b/assets/scripts/app/routes.coffee @@ -1,5 +1,13 @@ require 'travis/location' +Ember.Route.reopen + enter: (router) -> + @_super(router) + if @get('isLeafRoute') + path = @absoluteRoute(router) + if window.location.origin == 'https://travis-ci.org' + _gaq.push(['_trackPageview', path]); + defaultRoute = Ember.Route.extend route: '/' index: 1000 diff --git a/public/index.html b/public/index.html index e43cb9b6..e5a28bc7 100644 --- a/public/index.html +++ b/public/index.html @@ -15,5 +15,17 @@ + +