diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 21ee016..0bd2541 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -14,7 +14,6 @@ jobs: with: node-version: "20.x" registry-url: "https://registry.npmjs.org" - cache: yarn - name: Install node modules run: yarn --frozen-lockfile --prefer-offline - name: Run Biome diff --git a/src/lib/components/core/header/Header.svelte b/src/lib/components/core/header/Header.svelte index 7bbafb8..595f028 100644 --- a/src/lib/components/core/header/Header.svelte +++ b/src/lib/components/core/header/Header.svelte @@ -53,6 +53,7 @@ import Uploader from "../popups/popups/Uploader.svelte"; import Warning from "../popups/popups/Warning.svelte"; async function upload() { + window._paq.push(["trackEvent", "Main", "UploadClicked"]); popups.open({ component: Uploader, data: { diff --git a/src/lib/components/start/RobotSelector.svelte b/src/lib/components/start/RobotSelector.svelte index f19e653..bd4d366 100644 --- a/src/lib/components/start/RobotSelector.svelte +++ b/src/lib/components/start/RobotSelector.svelte @@ -10,6 +10,8 @@ interface Props { const { robots, secondary }: Props = $props(); function select(type: Robot) { + window._paq.push(["trackEvent", "SelectRobot", type.name]); + if ("variants" in type) return selected.set(type); if ("mode" in type) { code.set(type.defaultProgram); diff --git a/src/lib/matomo.ts b/src/lib/matomo.ts index 57eec87..af3374a 100644 --- a/src/lib/matomo.ts +++ b/src/lib/matomo.ts @@ -5,10 +5,11 @@ declare global { } function initMatomo() { + // Always create the _paq array so dev code works + const _paq = (window._paq = window._paq || []); // Only track prod builds if (!import.meta.env.PROD) return; - const _paq = (window._paq = window._paq || []); const u = import.meta.env.VITE_MATOMO_URL; _paq.push(["trackPageView"]); _paq.push(["enableLinkTracking"]);