mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-21 13:50:20 +08:00
Restored google analytics initialize inside mako templates
This commit is contained in:
+3
-1
@@ -65,7 +65,9 @@
|
||||
|
||||
${ galaxy_client.load( app=self.js_app ) }
|
||||
${ galaxy_client.config_sentry( app=self.js_app ) }
|
||||
${ galaxy_client.config_google_analytics( app=self.js_app ) }
|
||||
%if self.js_app and self.js_app.config and self.js_app.config.ga_code:
|
||||
${ galaxy_client.config_google_analytics(self.js_app.config.ga_code) }
|
||||
%endif
|
||||
|
||||
%if not form_input_auto_focus is UNDEFINED and form_input_auto_focus:
|
||||
<script type="text/javascript">
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
</script>
|
||||
|
||||
%if t.webapp.name == 'galaxy' and app.config.ga_code:
|
||||
${galaxy_client.config_google_analytics(app)}
|
||||
${galaxy_client.config_google_analytics(app.config.ga_code)}
|
||||
%endif
|
||||
|
||||
</%def>
|
||||
|
||||
@@ -39,8 +39,6 @@ ${ h.dumps( dictionary, indent=( 2 if trans.debug else 0 ) ) }
|
||||
%if app and app.config:
|
||||
<script type="text/javascript">
|
||||
|
||||
// TODO: make this work the same in all places, maybe
|
||||
// make a global func in galaxy_client_app?
|
||||
var sentry = {};
|
||||
%if app.config.sentry_dsn:
|
||||
sentry.sentry_dsn_public = "${app.config.sentry_dsn_public}"
|
||||
@@ -57,17 +55,20 @@ ${ h.dumps( dictionary, indent=( 2 if trans.debug else 0 ) ) }
|
||||
%endif
|
||||
</%def>
|
||||
|
||||
<%def name="config_google_analytics(app)">
|
||||
%if app and app.config and app.config.ga_code:
|
||||
<script>
|
||||
<%def name="config_google_analytics(ga_code)">
|
||||
<script>
|
||||
console.log("config_google_analytics ga_code:", '${ga_code}');
|
||||
%if 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('create', '${ga_code}', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script>
|
||||
%endif
|
||||
%else:
|
||||
console.warn("Missing google analytics code");
|
||||
%endif
|
||||
</script>
|
||||
</%def>
|
||||
|
||||
|
||||
|
||||
@@ -74,8 +74,10 @@
|
||||
</script>
|
||||
%endif
|
||||
|
||||
## ${ galaxy_client.config_sentry(app)}
|
||||
## ${ galaxy_client.config_google_analytics(app)}
|
||||
${ galaxy_client.config_sentry(app) }
|
||||
%if app.config.ga_code:
|
||||
${ galaxy_client.config_google_analytics(app.config.ga_code) }
|
||||
%endif
|
||||
|
||||
</%def>
|
||||
|
||||
|
||||
@@ -225,7 +225,7 @@
|
||||
</script>
|
||||
|
||||
${ galaxy_client.load() }
|
||||
## ${ galaxy_client.config_sentry(app) }
|
||||
${ galaxy_client.config_sentry(app) }
|
||||
|
||||
</%def>
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<%def name="masthead()">
|
||||
|
||||
%if app.config.ga_code:
|
||||
${galaxy_client.config_google_analytics(app)}
|
||||
${ galaxy_client.config_google_analytics(app.config.ga_code)}
|
||||
%endif
|
||||
|
||||
## start main tag
|
||||
|
||||
Reference in New Issue
Block a user