Switch to Google Analytics

This commit is contained in:
Thibaut 2014-05-03 11:00:32 -04:00
parent edffd6f502
commit 7e09b44468
2 changed files with 8 additions and 1 deletions

View file

@ -41,6 +41,7 @@ page.show = (path, state) ->
currentState = context.state
page.dispatch(context)
context.pushState()
ga?('send', 'pageview', location.pathname + location.search + location.hash)
context
page.replace = (path, state, skipDispatch, init) ->
@ -49,6 +50,7 @@ page.replace = (path, state, skipDispatch, init) ->
currentState = context.state
page.dispatch(context) unless skipDispatch
context.replaceState()
ga?('send', 'pageview', location.pathname + location.search + location.hash) unless init
context
page.dispatch = (context) ->

View file

@ -30,5 +30,10 @@
</section>
</div>
<% if App.production? %><script>
var _gauges=[];(function(){var a=document.createElement('script');a.async=true;a.id='gauges-tracker';a.setAttribute('data-site-id','51c15f82613f5d7819000067');a.src='//secure.gaug.es/track.js';var b=document.getElementsByTagName('script')[0];b.parentNode.insertBefore(a,b)})();
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-5544833-12', 'devdocs.io');
ga('send', 'pageview');
</script><% end %>