From 757767c9fd73b9081855f2b60c4da73246fc1273 Mon Sep 17 00:00:00 2001 From: Christoph Burgdorf Date: Mon, 9 Dec 2019 11:56:26 +0100 Subject: [PATCH] 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/ --- docs/_static/js/matomo.js | 11 +++++++++++ docs/conf.py | 3 +++ 2 files changed, 14 insertions(+) create mode 100644 docs/_static/js/matomo.js diff --git a/docs/_static/js/matomo.js b/docs/_static/js/matomo.js new file mode 100644 index 0000000..e6079ec --- /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', '20']); + 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); +})(); \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index d4d521a..43a02c2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -89,6 +89,9 @@ # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] +def setup(app): + app.add_js_file("js/matomo.js") + # Custom sidebar templates, must be a dictionary that maps document names # to template names. #