This is an automated email from the ASF dual-hosted git repository.

janhoy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr-site.git


The following commit(s) were added to refs/heads/main by this push:
     new 4202dff6d SOLR-17633 Enable Matomo tracking (#144)
4202dff6d is described below

commit 4202dff6d5e19dd33514bc7d4ca0ba072fe2e4d6
Author: Jan Høydahl <[email protected]>
AuthorDate: Sat Mar 1 22:36:49 2025 +0100

    SOLR-17633 Enable Matomo tracking (#144)
---
 themes/solr/templates/_matomo.html       | 17 +++++++++++++++++
 themes/solr/templates/base.html          |  1 +
 themes/solr/templates/operator/base.html |  1 +
 3 files changed, 19 insertions(+)

diff --git a/themes/solr/templates/_matomo.html 
b/themes/solr/templates/_matomo.html
new file mode 100644
index 000000000..a2a40693d
--- /dev/null
+++ b/themes/solr/templates/_matomo.html
@@ -0,0 +1,17 @@
+<!-- Matomo -->
+<script>
+  var _paq = window._paq = window._paq || [];
+  /* tracker methods like "setCustomDimension" should be called before 
"trackPageView" */
+  _paq.push(["setDoNotTrack", true]);
+  _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', '76']);
+    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 -->
diff --git a/themes/solr/templates/base.html b/themes/solr/templates/base.html
index a29686a84..6be0c94e0 100644
--- a/themes/solr/templates/base.html
+++ b/themes/solr/templates/base.html
@@ -25,6 +25,7 @@
    {% endblock %}
    {% block rss %}{% endblock %}
    {% block javascript %}{% endblock %}
+   {% include "_matomo.html" %}
   </head>
 
   <body class="page {% block bodyclass %}{% endblock %}" {% block 
ng_directives %}{% endblock %} x-ng-app="page" 
x-ng-controller="page.controllers.main">
diff --git a/themes/solr/templates/operator/base.html 
b/themes/solr/templates/operator/base.html
index 8356c985c..5da03d2bf 100644
--- a/themes/solr/templates/operator/base.html
+++ b/themes/solr/templates/operator/base.html
@@ -26,6 +26,7 @@
    {% endblock %}
    {% block rss %}{% endblock %}
    {% block javascript %}{% endblock %}
+   {% include "_matomo.html" %}
   </head>
 
   <body class="page {% block bodyclass %}{% endblock %}" {% block 
ng_directives %}{% endblock %} x-ng-app="page" 
x-ng-controller="page.controllers.main">

Reply via email to