Skip to content

Commit 775fe43

Browse files
authored
feat: add Matomo analytics tracking script (#626)
1 parent f9198dc commit 775fe43

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

website/docusaurus.config.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,29 @@ const config = {
200200
}
201201
}),
202202
themes: ['@docusaurus/theme-mermaid'],
203+
headTags: [
204+
{
205+
tagName: 'script',
206+
attributes: {
207+
type: 'text/javascript',
208+
},
209+
innerHTML: `
210+
var _paq = window._paq = window._paq || [];
211+
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
212+
_paq.push(["setDoNotTrack", true]);
213+
_paq.push(["disableCookies"]);
214+
_paq.push(['trackPageView']);
215+
_paq.push(['enableLinkTracking']);
216+
(function() {
217+
var u="https://analytics.apache.org/";
218+
_paq.push(['setTrackerUrl', u+'matomo.php']);
219+
_paq.push(['setSiteId', '83']);
220+
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
221+
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
222+
})();
223+
`,
224+
},
225+
],
203226
markdown: {
204227
format: 'md',
205228
mermaid: true,

0 commit comments

Comments
 (0)