Thibaut il y a 11 ans
Parent
commit
9ab3a394e9
2 fichiers modifiés avec 8 ajouts et 0 suppressions
  1. 2 0
      assets/javascripts/lib/page.coffee
  2. 6 0
      views/app.erb

+ 2 - 0
assets/javascripts/lib/page.coffee

@@ -42,6 +42,7 @@ page.show = (path, state) ->
   page.dispatch(context)
   context.pushState()
   ga?('send', 'pageview', location.pathname + location.search + location.hash)
+  _gauges?.push(['track'])
   context
 
 page.replace = (path, state, skipDispatch, init) ->
@@ -51,6 +52,7 @@ page.replace = (path, state, skipDispatch, init) ->
   page.dispatch(context) unless skipDispatch
   context.replaceState()
   ga?('send', 'pageview', location.pathname + location.search + location.hash) unless init
+  _gauges?.push(['track'])
   context
 
 page.dispatch = (context) ->

+ 6 - 0
views/app.erb

@@ -36,4 +36,10 @@
   })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
   ga('create', 'UA-5544833-12', 'devdocs.io');
   ga('send', 'pageview');
+</script><script>
+  var _gauges=_gauges||[];!function(){var a=document.createElement("script");
+  a.type="text/javascript",a.async=!0,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)}();
 </script><% end %>