diff --git a/client/src/galaxy.library.js b/client/src/galaxy.library.js index 0f77a558d40..05e76258ca8 100644 --- a/client/src/galaxy.library.js +++ b/client/src/galaxy.library.js @@ -69,8 +69,8 @@ var LibraryRouter = Backbone.Router.extend({ if (typeof ga !== "undefined") { ga("send", "pageview", `${getAppRoot()}library/list${url}`); } - if (typeof plausible !== "undefined") { - plausible(`pageview ${getAppRoot()}library/list${url}`); + if (typeof window.plausible !== "undefined") { + window.plausible(`pageview ${getAppRoot()}library/list${url}`); } if (typeof window._paq !== "undefined") { window._paq.push(['setCustomUrl', `${getAppRoot()}library/list${url}`]); @@ -138,7 +138,9 @@ var GalaxyLibrary = Backbone.View.extend({ var u=Galaxy.config.matomo_server+"/"; _paq.push(['setTrackerUrl', u+'matomo.php']); _paq.push(['setSiteId', Galaxy.config.matomo_site_id]); - var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; + var d=document; + var g=d.createElement('script'); + var s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); })(); } diff --git a/doc/source/admin/galaxy_options.rst b/doc/source/admin/galaxy_options.rst index 65ebb79d403..5fd1916ec8a 100644 --- a/doc/source/admin/galaxy_options.rst +++ b/doc/source/admin/galaxy_options.rst @@ -1468,6 +1468,51 @@ :Type: str +~~~~~~~~~~~~~~~~~~~~ +``plausible_server`` +~~~~~~~~~~~~~~~~~~~~ + +:Description: + Please enter the URL for the Plausible server (including https) so + this can be used for tracking with Plausible + (https://plausible.io/). +:Default: ``None`` +:Type: str + + +~~~~~~~~~~~~~~~~~~~~ +``plausible_domain`` +~~~~~~~~~~~~~~~~~~~~ + +:Description: + Please enter the URL for the Galaxy server so this can be used for + tracking with Plausible (https://plausible.io/). +:Default: ``None`` +:Type: str + + +~~~~~~~~~~~~~~~~~ +``matomo_server`` +~~~~~~~~~~~~~~~~~ + +:Description: + Please enter the URL for the Matomo server (including https) so + this can be used for tracking with Matomo (https://matomo.org/). +:Default: ``None`` +:Type: str + + +~~~~~~~~~~~~~~~~~~ +``matomo_site_id`` +~~~~~~~~~~~~~~~~~~ + +:Description: + Please enter the site ID for the Matomo server so this can be used + for tracking with Matomo (https://matomo.org/). +:Default: ``None`` +:Type: str + + ~~~~~~~~~~~~~~~~~~~ ``display_servers`` ~~~~~~~~~~~~~~~~~~~ diff --git a/lib/galaxy/config/sample/galaxy.yml.sample b/lib/galaxy/config/sample/galaxy.yml.sample index be92803ec17..132aee92612 100644 --- a/lib/galaxy/config/sample/galaxy.yml.sample +++ b/lib/galaxy/config/sample/galaxy.yml.sample @@ -817,14 +817,23 @@ galaxy: # your Google Analytics account. Example: UA-XXXXXXXX-Y #ga_code: null - # Please enter the URL for the Plausible server (including https) so this can be used for tracking - # with Plausible (https://plausible.io/). - # plausible_server: null + # Please enter the URL for the Plausible server (including https) so + # this can be used for tracking with Plausible + # (https://plausible.io/). + #plausible_server: null - # Please enter the URL for the Galaxy server so this can be used for tracking - # with Plausible (https://plausible.io/). + # Please enter the URL for the Galaxy server so this can be used for + # tracking with Plausible (https://plausible.io/). #plausible_domain: null + # Please enter the URL for the Matomo server (including https) so this + # can be used for tracking with Matomo (https://matomo.org/). + #matomo_server: null + + # Please enter the site ID for the Matomo server so this can be used + # for tracking with Matomo (https://matomo.org/). + #matomo_site_id: null + # Galaxy can display data at various external browsers. These options # specify which browsers should be available. URLs and builds # available at these browsers are defined in the specified files. diff --git a/lib/galaxy/config/sample/tool_shed.yml.sample b/lib/galaxy/config/sample/tool_shed.yml.sample index b9f0ec180f3..3ba6eb2948e 100644 --- a/lib/galaxy/config/sample/tool_shed.yml.sample +++ b/lib/galaxy/config/sample/tool_shed.yml.sample @@ -179,14 +179,23 @@ tool_shed: # your Google Analytics account. Example: UA-XXXXXXXX-Y #ga_code: null - # Please enter the URL for the Plausible server (including https) so this can be used for tracking - # with Plausible (https://plausible.io/). - # plausible_server: null + # Please enter the URL for the Plausible server (including https) so + # this can be used for tracking with Plausible + # (https://plausible.io/). + #plausible_server: null - # Please enter the URL for the Galaxy server so this can be used for tracking - # with Plausible (https://plausible.io/). + # Please enter the URL for the Galaxy server so this can be used for + # tracking with Plausible (https://plausible.io/). #plausible_domain: null + # Please enter the URL for the Matomo server (including https) so this + # can be used for tracking with Matomo (https://matomo.org/). + #matomo_server: null + + # Please enter the site ID for the Matomo server so this can be used + # for tracking with Matomo (https://matomo.org/). + #matomo_site_id: null + # The Tool Shed encodes various internal values when these values will # be output in some format (for example, in a URL or cookie). You # should set a key to be used by the algorithm that encodes and diff --git a/lib/tool_shed/webapp/templates/galaxy_client_app.mako b/lib/tool_shed/webapp/templates/galaxy_client_app.mako index 2f89b061fdd..a8ed317e27b 100644 --- a/lib/tool_shed/webapp/templates/galaxy_client_app.mako +++ b/lib/tool_shed/webapp/templates/galaxy_client_app.mako @@ -71,10 +71,6 @@ ${ h.dumps( dictionary, indent=( 2 if trans.debug else 0 ) ) } <%def name="config_plausible_analytics(plausible_server, plausible_domain)"> - %if plausible_server and plausible_domain: %else: @@ -95,7 +91,9 @@ ${ h.dumps( dictionary, indent=( 2 if trans.debug else 0 ) ) } var u = "${matomo_server}/"; _paq.push(['setTrackerUrl', u + 'matomo.php']); _paq.push(['setSiteId', '${matomo_site_id}']); - var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0]; + var d = document; + var g = d.createElement('script'); + var s = d.getElementsByTagName('script')[0]; g.type = 'text/javascript'; g.async = true; g.src = u + 'matomo.js'; diff --git a/templates/galaxy_client_app.mako b/templates/galaxy_client_app.mako index cb199e5b299..240a9b50616 100644 --- a/templates/galaxy_client_app.mako +++ b/templates/galaxy_client_app.mako @@ -72,15 +72,13 @@ ${ h.dumps( dictionary, indent=( 2 if trans.debug else 0 ) ) } <%def name="config_plausible_analytics(plausible_server, plausible_domain)"> - %if plausible_server and plausible_domain: %else: - + %endif @@ -97,7 +95,9 @@ ${ h.dumps( dictionary, indent=( 2 if trans.debug else 0 ) ) } var u = "${matomo_server}/"; _paq.push(['setTrackerUrl', u + 'matomo.php']); _paq.push(['setSiteId', '${matomo_site_id}']); - var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0]; + var d = document; + var g = d.createElement('script'); + var s = d.getElementsByTagName('script')[0]; g.type = 'text/javascript'; g.async = true; g.src = u + 'matomo.js';