From 5ad7f8a41df64422b29578ce496b99e03cc5e2c7 Mon Sep 17 00:00:00 2001 From: Christoph Burgdorf Date: Fri, 6 Dec 2019 11:02:20 +0100 Subject: [PATCH] Add Matomo Tracking --- docs/_static/js/matomo.js | 11 +++++++++++ docs/conf.py | 5 ++++- newsfragments/1541.doc.rst | 7 +++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 docs/_static/js/matomo.js create mode 100644 newsfragments/1541.doc.rst diff --git a/docs/_static/js/matomo.js b/docs/_static/js/matomo.js new file mode 100644 index 0000000000..c57dfbaa78 --- /dev/null +++ b/docs/_static/js/matomo.js @@ -0,0 +1,11 @@ +var _paq = window._paq || []; +/* tracker methods like "setCustomDimension" should be called before "trackPageView" */ +_paq.push(['trackPageView']); +_paq.push(['enableLinkTracking']); +(function() { + var u="https://matomo.ethereum.org/piwik/"; + _paq.push(['setTrackerUrl', u+'matomo.php']); + _paq.push(['setSiteId', '18']); + var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; + g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); +})(); diff --git a/docs/conf.py b/docs/conf.py index 1aaf119408..a2b590a92a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -149,7 +149,10 @@ # 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'] +html_static_path = ['_static'] + +def setup(app): + app.add_js_file("js/matomo.js") # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied diff --git a/newsfragments/1541.doc.rst b/newsfragments/1541.doc.rst new file mode 100644 index 0000000000..7386046038 --- /dev/null +++ b/newsfragments/1541.doc.rst @@ -0,0 +1,7 @@ +Add Matomo Tracking to Docs site. + +Matomo is an Open Source web analytics platform that allows us +to get better insights and optimize for our audience without +the negative consequences of other compareable platforms. + +Read more: https://matomo.org/why-matomo/ \ No newline at end of file