From dce091d87e38bcf9141bd95324acc6e6fac29cc6 Mon Sep 17 00:00:00 2001 From: Marco Walz Date: Tue, 28 Apr 2026 17:31:38 +0200 Subject: [PATCH] infra(analytics): add Matomo tracking (site ID 19, portal CSP) --- astro.config.mjs | 4 ++++ public/.ic-assets.json5 | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/astro.config.mjs b/astro.config.mjs index aa0f9f3e..dda0f7b4 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -94,6 +94,10 @@ export default defineConfig({ ], }), }, + { + tag: "script", + content: `var _paq=window._paq=window._paq||[];_paq.push(["disableCookies"]);_paq.push(["enableLinkTracking"]);_paq.push(["trackPageView"]);(function(){var u="https://internetcomputer.matomo.cloud/";_paq.push(["setTrackerUrl",u+"matomo.php"]);_paq.push(["setSiteId","19"]);var d=document,g=d.createElement("script"),s=d.getElementsByTagName("script")[0];g.async=true;g.src="https://cdn.matomo.cloud/internetcomputer.matomo.cloud/matomo.js";s.parentNode.insertBefore(g,s)})()`, + }, { tag: "script", content: `document.addEventListener('DOMContentLoaded',()=>{document.querySelectorAll('a[href^="http"]').forEach(a=>{a.setAttribute('target','_blank');a.setAttribute('rel','noopener noreferrer')});document.querySelectorAll('[data-copy]').forEach(b=>{b.addEventListener('click',()=>{navigator.clipboard.writeText(b.dataset.copy);const i=b.querySelector('svg');if(i){const orig=i.innerHTML;i.innerHTML='';i.style.stroke='#22c55e';i.style.opacity='1';setTimeout(()=>{i.innerHTML=orig;i.style.stroke='';i.style.opacity=''},1500)}})});const sb=document.getElementById('skills-give-btn');const sl=document.getElementById('skills-give-label');if(sb&&sl){const orig=sl.textContent;sb.addEventListener('click',()=>{navigator.clipboard.writeText('Fetch https://skills.internetcomputer.org/llms.txt and follow its instructions when building on ICP').catch(()=>{});sl.textContent='Now paste into your agent';setTimeout(()=>{sl.textContent=orig},3000)})}})`, diff --git a/public/.ic-assets.json5 b/public/.ic-assets.json5 index 9cf26a80..a146ecbe 100644 --- a/public/.ic-assets.json5 +++ b/public/.ic-assets.json5 @@ -8,7 +8,7 @@ // Starlight uses inline