mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-16 15:45:04 +08:00
feat: cookieless matomo integration (untested)
This commit is contained in:
@@ -2144,6 +2144,20 @@
|
||||
:Type: str
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
``matomo_disable_cookies``
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
:Description:
|
||||
Run Matomo in "cookieless" mode. When set to true (the default),
|
||||
Galaxy instructs the Matomo tracker to disable all tracking
|
||||
cookies by calling _paq.push(['disableCookies']) before tracking
|
||||
the page view. Set to false to allow Matomo to use cookies. See
|
||||
https://matomo.org/faq/general/faq_157/ for details.
|
||||
:Default: ``true``
|
||||
:Type: bool
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
``display_servers``
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -165,6 +165,7 @@ class GalaxyAppConfigurationAttributes:
|
||||
plausible_domain: str | None
|
||||
matomo_server: str | None
|
||||
matomo_site_id: str | None
|
||||
matomo_disable_cookies: bool
|
||||
display_servers: str
|
||||
enable_old_display_applications: bool
|
||||
aws_estimate: bool
|
||||
|
||||
@@ -1426,6 +1426,13 @@ galaxy:
|
||||
# for tracking with Matomo (https://matomo.org/).
|
||||
#matomo_site_id: null
|
||||
|
||||
# Run Matomo in "cookieless" mode. When set to true (the default),
|
||||
# Galaxy instructs the Matomo tracker to disable all tracking cookies
|
||||
# by calling _paq.push(['disableCookies']) before tracking the page
|
||||
# view. Set to false to allow Matomo to use cookies. See
|
||||
# https://matomo.org/faq/general/faq_157/ for details.
|
||||
#matomo_disable_cookies: true
|
||||
|
||||
# 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.
|
||||
|
||||
@@ -1605,6 +1605,17 @@ mapping:
|
||||
Please enter the site ID for the Matomo server so this can be used for tracking
|
||||
with Matomo (https://matomo.org/).
|
||||
|
||||
matomo_disable_cookies:
|
||||
type: bool
|
||||
default: true
|
||||
required: false
|
||||
desc: |
|
||||
Run Matomo in "cookieless" mode. When set to true (the default), Galaxy
|
||||
instructs the Matomo tracker to disable all tracking cookies by calling
|
||||
_paq.push(['disableCookies']) before tracking the page view. Set to false
|
||||
to allow Matomo to use cookies. See
|
||||
https://matomo.org/faq/general/faq_157/ for details.
|
||||
|
||||
display_servers:
|
||||
type: str
|
||||
default: hgw1.cse.ucsc.edu,hgw2.cse.ucsc.edu,hgw3.cse.ucsc.edu,hgw4.cse.ucsc.edu,hgw5.cse.ucsc.edu,hgw6.cse.ucsc.edu,hgw7.cse.ucsc.edu,hgw8.cse.ucsc.edu,lowepub.cse.ucsc.edu
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
${ config_plausible_analytics(app.config.plausible_server, app.config.plausible_domain) }
|
||||
%endif
|
||||
%if app.config.matomo_server and app.config.matomo_site_id:
|
||||
${ config_matomo_analytics(app.config.matomo_server, app.config.matomo_site_id) }
|
||||
${ config_matomo_analytics(app.config.matomo_server, app.config.matomo_site_id, app.config.matomo_disable_cookies) }
|
||||
%endif
|
||||
</body>
|
||||
</html>
|
||||
@@ -93,13 +93,16 @@
|
||||
%endif
|
||||
</%def>
|
||||
|
||||
<%def name="config_matomo_analytics(matomo_server, matomo_site_id)">
|
||||
<%def name="config_matomo_analytics(matomo_server, matomo_site_id, matomo_disable_cookies=True)">
|
||||
<script type="text/javascript">
|
||||
console.log("config_matomo_analytics matomo_server:", '${matomo_server}');
|
||||
console.log("config_matomo_analytics matomo_site_id:", '${matomo_site_id}')
|
||||
%if matomo_server and matomo_site_id:
|
||||
var _paq = window._paq = window._paq || [];
|
||||
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
||||
%if matomo_disable_cookies:
|
||||
_paq.push(['disableCookies']);
|
||||
%endif
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function () {
|
||||
|
||||
Reference in New Issue
Block a user