From ef2f1dc637887ccca8bd9dd1d4420ebf3efd9a8b Mon Sep 17 00:00:00 2001 From: Leah Wasser Date: Mon, 6 Mar 2023 10:57:23 -0700 Subject: [PATCH] Add matomo to guide --- _static/matomo.js | 12 ++++++++++++ conf.py | 6 +----- 2 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 _static/matomo.js diff --git a/_static/matomo.js b/_static/matomo.js new file mode 100644 index 000000000..512315c78 --- /dev/null +++ b/_static/matomo.js @@ -0,0 +1,12 @@ +// Matomo analytics +var _paq = window._paq = window._paq || []; +/* tracker methods like "setCustomDimension" should be called before "trackPageView" */ +_paq.push(['trackPageView']); +_paq.push(['enableLinkTracking']); +(function() { + var u="https://pyopensci.matomo.cloud/"; + _paq.push(['setTrackerUrl', u+'matomo.php']); + _paq.push(['setSiteId', '2']); + var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; + g.async=true; g.src='//cdn.matomo.cloud/pyopensci.matomo.cloud/matomo.js'; s.parentNode.insertBefore(g,s); +})(); diff --git a/conf.py b/conf.py index 921251bb0..f730762c0 100644 --- a/conf.py +++ b/conf.py @@ -128,10 +128,6 @@ html_theme = 'pydata_sphinx_theme' html_static_path = ["_static"] html_css_files = ["pyos.css"] +html_js_files = ["matomo.js"] html_title = "pyOpenSci Package Guide" html_logo = "images/logo/logo.png" - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static']