Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLING-11204 enable web analytics with ASF Matomo #88

Merged
merged 1 commit into from
Mar 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 -->
'''
}