Add google analytics
This commit is contained in:
parent
d4214406e6
commit
cdbfac1166
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user