Skip to content

Commit

Permalink
SLING-11204 enable web analytics with ASF Matomo
Browse files Browse the repository at this point in the history
  • Loading branch information
kwin committed Mar 14, 2022
1 parent b6242ba commit 3652974
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/main/jbake/templates/footer.tpl
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import java.text.SimpleDateFormat

p() {
yield "Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project "
yield "logo are trademarks of The Apache Software Foundation. All other marks mentioned "
yield "may be trademarks or registered trademarks of their respective owners."
yield '''Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project
logo are trademarks of The Apache Software Foundation. All other marks mentioned
may be trademarks or registered trademarks of their respective owners.'''
}
p() {
String currentYear = new SimpleDateFormat("YYYY").format(new Date())
yield "Copyright \u00a9 2007-${currentYear} The Apache Software Foundation."
yield "Copyright \u00a9 2007-${currentYear}"
a(href:'https://www.apache.org/') {
yield 'The Apache Software Foundation'
}
yield '|'
a(href:'https://privacy.apache.org/policies/privacy-policy-public.html') {
yield 'Privacy Policy'
}
}
19 changes: 19 additions & 0 deletions src/main/jbake/templates/header.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,23 @@ head {
script {
yield 'hljs.initHighlightingOnLoad();'
} newLine()
yieldUnescaped '''
<!-- Matomo Web Analytics -->
<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://matomo.privacy.apache.org/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '6']);
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 -->
'''
}

0 comments on commit 3652974

Please sign in to comment.