1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/29a536155bf4/ Changeset: 29a536155bf4 User: martenson Date: 2014-11-04 15:31:15+00:00 Summary: initial commit of google analytics tracking for toolshed Affected #: 3 files diff -r d53d0150e936944c6a9e10dad1533a9645d37c48 -r 29a536155bf46e3c3dfa4f17760fda17f1e1835d config/tool_shed.ini.sample --- a/config/tool_shed.ini.sample +++ b/config/tool_shed.ini.sample @@ -46,6 +46,12 @@ session_key = galaxysessions session_secret = changethisinproduction +# -- Analytics + +# You can enter tracking code here to track visitor's behavior +# through your Google Analytics account. Example: UA-XXXXXXXX-Y +#ga_code = None + # -- Users and Security # Galaxy encodes various internal values when these values will be output in diff -r d53d0150e936944c6a9e10dad1533a9645d37c48 -r 29a536155bf46e3c3dfa4f17760fda17f1e1835d lib/galaxy/webapps/tool_shed/config.py --- a/lib/galaxy/webapps/tool_shed/config.py +++ b/lib/galaxy/webapps/tool_shed/config.py @@ -40,6 +40,8 @@ self.database_connection = kwargs.get( "database_connection", False ) self.database_engine_options = get_database_engine_options( kwargs ) self.database_create_tables = string_as_bool( kwargs.get( "database_create_tables", "True" ) ) + # Analytics + self.ga_code = kwargs.get( "ga_code", None ) # Where dataset files are stored self.file_path = resolve_path( kwargs.get( "file_path", "database/community_files" ), self.root ) self.new_file_path = resolve_path( kwargs.get( "new_file_path", "database/tmp" ), self.root ) diff -r d53d0150e936944c6a9e10dad1533a9645d37c48 -r 29a536155bf46e3c3dfa4f17760fda17f1e1835d templates/webapps/tool_shed/base_panels.mako --- a/templates/webapps/tool_shed/base_panels.mako +++ b/templates/webapps/tool_shed/base_panels.mako @@ -10,6 +10,17 @@ ## Masthead <%def name="masthead()"> + %if app.config.ga_code: + <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','//www.google-analytics.com/analytics.js','ga'); + ga('create', '${app.config.ga_code}', 'auto'); + ga('send', 'pageview'); + </script> + %endif + ## start main tag <div id="masthead" class="navbar navbar-fixed-top navbar-inverse"> Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.