Add Matomo Analytics to cookbook (#283)

diff --git a/build/index.html b/build/index.html
index eb98841..93e8f7e 100644
--- a/build/index.html
+++ b/build/index.html
@@ -28,6 +28,24 @@
 				width: 100%;
 			}
 		</style>
+		<!-- Matomo -->
+		<script>
+			var _paq = window._paq = window._paq || [];
+			/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
+			/* We explicitly disable cookie tracking to avoid privacy issues */
+			_paq.push(['disableCookies']);
+			_paq.push(['trackPageView']);
+			_paq.push(['enableLinkTracking']);
+			(function() {
+				var u="https://analytics.apache.org/";
+				_paq.push(['setTrackerUrl', u+'matomo.php']);
+				_paq.push(['setSiteId', '20']);
+				var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
+				g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
+			})();
+		</script>
+		<!-- End Matomo Code -->
+		
 	</head>
 	<body>
 		<div id="logo"><img src="arrow.png"/></div>
diff --git a/cpp/source/_templates/layout.html b/cpp/source/_templates/layout.html
new file mode 100644
index 0000000..05518a8
--- /dev/null
+++ b/cpp/source/_templates/layout.html
@@ -0,0 +1,6 @@
+{% extends "!layout.html" %}
+{# Use Matomo #}
+{% block extrahead %}
+  {{ super() }}
+  {%- include "../../../matomo.html" %}
+{% endblock %}
diff --git a/java/source/_templates/layout.html b/java/source/_templates/layout.html
new file mode 100644
index 0000000..05518a8
--- /dev/null
+++ b/java/source/_templates/layout.html
@@ -0,0 +1,6 @@
+{% extends "!layout.html" %}
+{# Use Matomo #}
+{% block extrahead %}
+  {{ super() }}
+  {%- include "../../../matomo.html" %}
+{% endblock %}
diff --git a/matomo.html b/matomo.html
new file mode 100644
index 0000000..21948c0
--- /dev/null
+++ b/matomo.html
@@ -0,0 +1,17 @@
+  <!-- Matomo -->
+  <script>
+    var _paq = window._paq = window._paq || [];
+    /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
+    /* We explicitly disable cookie tracking to avoid privacy issues */
+    _paq.push(['disableCookies']);
+    _paq.push(['trackPageView']);
+    _paq.push(['enableLinkTracking']);
+    (function() {
+      var u="https://analytics.apache.org/";
+      _paq.push(['setTrackerUrl', u+'matomo.php']);
+      _paq.push(['setSiteId', '20']);
+      var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
+      g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
+    })();
+  </script>
+  <!-- End Matomo Code -->
\ No newline at end of file
diff --git a/python/source/_templates/layout.html b/python/source/_templates/layout.html
new file mode 100644
index 0000000..05518a8
--- /dev/null
+++ b/python/source/_templates/layout.html
@@ -0,0 +1,6 @@
+{% extends "!layout.html" %}
+{# Use Matomo #}
+{% block extrahead %}
+  {{ super() }}
+  {%- include "../../../matomo.html" %}
+{% endblock %}
diff --git a/r/content/_bookdown.yml b/r/content/_bookdown.yml
index 06a5f3e..73da467 100644
--- a/r/content/_bookdown.yml
+++ b/r/content/_bookdown.yml
@@ -33,3 +33,8 @@
   "python.Rmd",
   "flight.Rmd"
 ]
+
+output:
+  bookdown::gitbook:
+    includes:
+      in_header: ../../matomo.html