mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-09-29 05:36:48 +02:00
Switch to Google Analytics
This commit is contained in:
parent
edffd6f502
commit
7e09b44468
2 changed files with 8 additions and 1 deletions
|
@ -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) ->
|
||||
|
|
|
@ -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 %>
|
||||
|
|
Loading…
Reference in a new issue