diff --git a/astro.config.mjs b/astro.config.mjs index bb514e6..78b441f 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -32,6 +32,18 @@ export default defineConfig({ replacesTitle: true, }, }), +// https://github.com/felix-berlin/astro-matomo + matomo({ + enabled: import.meta.env.PROD, // Only load in production + host: "https://matomo.workaround.org/", + setCookieDomain: "*.workaround.org", + trackerUrl: "js/", // defaults to matomo.php + srcUrl: "js/", // defaults to matomo.js + siteId: 1, + heartBeatTimer: 5, + disableCookies: true, + debug: false, + }), sitemap(), ], }); diff --git a/package.json b/package.json index 26ffcc2..eb95519 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "@astrojs/sitemap": "^3.2.1", "@astrojs/starlight": "^0.28.3", "astro": "^4.15.3", + "astro-matomo": "^1.7.0", "sharp": "^0.32.5", "typescript": "^5.6.3" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c251193..3df824c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,6 +20,9 @@ importers: astro: specifier: ^4.15.3 version: 4.16.7(rollup@4.24.0)(typescript@5.6.3) + astro-matomo: + specifier: ^1.7.0 + version: 1.7.0(astro@4.16.7(rollup@4.24.0)(typescript@5.6.3)) sharp: specifier: ^0.32.5 version: 0.32.6 @@ -775,6 +778,11 @@ packages: peerDependencies: astro: ^4.0.0-beta || ^3.3.0 + astro-matomo@1.7.0: + resolution: {integrity: sha512-TpgiP4X1ZiAFnPn73eOQtbEj0bRJX46q2a4oClswYtjZXbqaCnWFSfZjRByEk6RQsLXFAgBqvBUL0XF1VRSf4A==} + peerDependencies: + astro: ^2.0.0-beta.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 + astro@4.16.7: resolution: {integrity: sha512-nON+8MUEkWTFwXbS4zsQIq4t0Fs42eulM4x236AL+qNnWfqNAOOqAnFxO1dxfJ1q+XopIBbbT9Mtev+0zH47PQ==} engines: {node: ^18.17.1 || ^20.3.0 || >=21.0.0, npm: '>=9.6.5', pnpm: '>=7.1.0'} @@ -3127,6 +3135,10 @@ snapshots: astro: 4.16.7(rollup@4.24.0)(typescript@5.6.3) rehype-expressive-code: 0.35.6 + astro-matomo@1.7.0(astro@4.16.7(rollup@4.24.0)(typescript@5.6.3)): + dependencies: + astro: 4.16.7(rollup@4.24.0)(typescript@5.6.3) + astro@4.16.7(rollup@4.24.0)(typescript@5.6.3): dependencies: '@astrojs/compiler': 2.10.3