From a56810bc3145a99a91b76c8e5961b63d30359826 Mon Sep 17 00:00:00 2001 From: baalajimaestro Date: Mon, 15 Jul 2024 13:30:24 +0530 Subject: [PATCH] Add matomo Signed-off-by: baalajimaestro --- src/components/BaseHead.astro | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/BaseHead.astro b/src/components/BaseHead.astro index 7a09621..3e75690 100644 --- a/src/components/BaseHead.astro +++ b/src/components/BaseHead.astro @@ -104,4 +104,16 @@ function formatCanonicalURL(url: string | URL) { document.addEventListener('astro:page-load', () => { nprogress.done() }) + + var _paq = window._paq = window._paq || []; + /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ + _paq.push(['trackPageView']); + _paq.push(['enableLinkTracking']); + (function() { + var u="https://stats.ptr.moe/"; + _paq.push(['setTrackerUrl', u+'86eff12f2496']); + _paq.push(['setSiteId', '1']); + var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; + g.async=true; g.src=u+'dd168412e25a.js'; s.parentNode.insertBefore(g,s); + })();