Skip to content

Commit 459965f

Browse files
authored
docs: set up Matomo for website analytics (#4176)
This PR sets up Matomo analytics for the ADBC docs sub-website (/adbc) using the same approach and site ID as Arrow used to set up theirs: apache/arrow#31788. I tested this PR locally by building the docs site and confirming my change injects the `script` tag in the `head` tag of pages.
1 parent bc4e273 commit 459965f

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

docs/source/_templates/base.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,24 @@
7070
font-weight: bold;
7171
}
7272
</style>
73+
74+
<!-- Matomo -->
75+
<script>
76+
var _paq = window._paq = window._paq || [];
77+
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
78+
/* We explicitly disable cookie tracking to avoid privacy issues */
79+
_paq.push(['disableCookies']);
80+
_paq.push(['trackPageView']);
81+
_paq.push(['enableLinkTracking']);
82+
(function() {
83+
var u="https://analytics.apache.org/";
84+
_paq.push(['setTrackerUrl', u+'matomo.php']);
85+
_paq.push(['setSiteId', '20']);
86+
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
87+
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
88+
})();
89+
</script>
90+
<!-- End Matomo Code -->
7391
{% endblock %}
7492

7593
{# Inject skeleton of version switcher #}

0 commit comments

Comments
 (0)