Add google analytics

This commit is contained in:
Piotr Sarnacki 2012-11-17 12:19:15 +01:00
parent d4214406e6
commit cdbfac1166
2 changed files with 20 additions and 0 deletions

View File

@ -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

View File

@ -15,5 +15,17 @@
</script>
</head>
<body id="home"></body>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-24868285-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</html>