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

hansva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hop-website.git


The following commit(s) were added to refs/heads/main by this push:
     new 5fba80f808 Add analytics back (#285)
5fba80f808 is described below

commit 5fba80f808545853b923c67f366a5662a9c04dcc
Author: Hans Van Akelyen <[email protected]>
AuthorDate: Fri Sep 25 09:09:56 2026 +0200

    Add analytics back (#285)
---
 src/layouts/Base.astro |  1 +
 static/js/matomo.js    | 33 +++++++++++++++++++++++++++++++++
 tools/sync-nav.mjs     |  1 +
 3 files changed, 35 insertions(+)

diff --git a/src/layouts/Base.astro b/src/layouts/Base.astro
index b34fecb2a5..cbee69fb7d 100644
--- a/src/layouts/Base.astro
+++ b/src/layouts/Base.astro
@@ -44,5 +44,6 @@ const image = new URL(ogImage, site.url).href
   <slot />
   <Footer />
   <script src="/js/site.js" is:inline></script>
+  <script src="/js/matomo.js" is:inline></script>
 </body>
 </html>
diff --git a/static/js/matomo.js b/static/js/matomo.js
new file mode 100644
index 0000000000..af37832541
--- /dev/null
+++ b/static/js/matomo.js
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/*
+ * Matomo page-view tracking on the ASF instance (site 11). Shared by the
+ * Astro pages and the Antora manuals so both halves report to one site.
+ * Cookies stay disabled to avoid privacy issues.
+ */
+var _paq = window._paq = window._paq || []
+_paq.push(['disableCookies'])
+/* tracker methods like "setCustomDimension" must be called before 
"trackPageView" */
+_paq.push(['trackPageView'])
+_paq.push(['enableLinkTracking'])
+;(function () {
+  var u = 'https://analytics.apache.org/'
+  _paq.push(['setTrackerUrl', u + 'matomo.php'])
+  _paq.push(['setSiteId', '11'])
+  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)
+})()
diff --git a/tools/sync-nav.mjs b/tools/sync-nav.mjs
index 0155240254..e847136a8a 100644
--- a/tools/sync-nav.mjs
+++ b/tools/sync-nav.mjs
@@ -146,6 +146,7 @@ ${columns}
 </footer>
 
 <script src="{{siteRootPath}}/js/site.js"></script>
+<script src="{{siteRootPath}}/js/matomo.js"></script>
 <script src="{{uiRootPath}}/js/tabs.js"></script>
 `
 

Reply via email to