Move tracking scripts inside the JS bundle

pull/417/head
Thibaut Courouble 9 years ago
parent a59786be2e
commit fd6683f3b2

@ -18,6 +18,8 @@
#= require_tree ./templates
#= require tracking
init = ->
document.removeEventListener 'DOMContentLoaded', init, false

@ -0,0 +1,20 @@
try {
if (app.config.env == 'production') {
(function() {
(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','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-5544833-12', 'devdocs.io');
ga('send', 'pageview');
})();
(function() {
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="https://secure.gaug.es/track.js";var b=document.getElementsByTagName("script")[0];
b.parentNode.insertBefore(a,b)}();
})();
}
} catch(e) { }

@ -30,20 +30,6 @@
<div class="_content _content-loading"></div>
</section>
</div>
<% if App.production? %><script>
(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','https://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="https://secure.gaug.es/track.js";var b=document.getElementsByTagName("script")[0];
b.parentNode.insertBefore(a,b)}();
</script><% end %>
<style data-size="<%= app_size %>" data-resizer>
._container { margin-left: <%= app_size %>; }
._search, ._list, ._sidebar-footer { width: <%= app_size %>; }

Loading…
Cancel
Save