diff --git a/templates/webapps/galaxy/root/index.mako b/templates/webapps/galaxy/root/index.mako index ac4453a291a..e6370ae818a 100644 --- a/templates/webapps/galaxy/root/index.mako +++ b/templates/webapps/galaxy/root/index.mako @@ -60,4 +60,13 @@ ${h.css("base")} var app = new App( ${ h.dumps( app_config ) } ); } ); }); - \ No newline at end of file + + %if app.config.ga_code: + (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', '${app.config.ga_code}', 'auto'); + ga('send', 'pageview'); + %endif +