{"id":14959311,"url":"https://github.com/felix-berlin/astro-matomo","last_synced_at":"2025-05-02T12:31:36.935Z","repository":{"id":83956062,"uuid":"606462776","full_name":"felix-berlin/astro-matomo","owner":"felix-berlin","description":"Matomo integration for Astro","archived":false,"fork":false,"pushed_at":"2025-04-07T19:57:22.000Z","size":31008,"stargazers_count":14,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-30T20:36:21.492Z","etag":null,"topics":["analytics","astrojs","dsgvo","gdrp","gpr","matomo","privacy-friendly","withastro"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/felix-berlin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"felix-berlin","ko_fi":"felixberlin","custom":["https://paypal.me/FelixScholze","https://www.buymeacoffee.com/felixberlin"]}},"created_at":"2023-02-25T15:13:42.000Z","updated_at":"2025-04-07T19:57:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"8a714cf9-81f8-4e26-8c9c-5711b87d2585","html_url":"https://github.com/felix-berlin/astro-matomo","commit_stats":{"total_commits":76,"total_committers":6,"mean_commits":"12.666666666666666","dds":0.5657894736842105,"last_synced_commit":"e9d0c3c2aecd6edfab0c3595f0ff77f73903d9da"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felix-berlin%2Fastro-matomo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felix-berlin%2Fastro-matomo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felix-berlin%2Fastro-matomo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felix-berlin%2Fastro-matomo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/felix-berlin","download_url":"https://codeload.github.com/felix-berlin/astro-matomo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252038180,"owners_count":21684640,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","astrojs","dsgvo","gdrp","gpr","matomo","privacy-friendly","withastro"],"created_at":"2024-09-24T13:19:25.694Z","updated_at":"2025-05-02T12:31:36.928Z","avatar_url":"https://github.com/felix-berlin.png","language":"TypeScript","funding_links":["https://github.com/sponsors/felix-berlin","https://ko-fi.com/felixberlin","https://paypal.me/FelixScholze","https://www.buymeacoffee.com/felixberlin"],"categories":[],"sub_categories":[],"readme":"# Astro Matomo\r\n\r\n![npm](https://img.shields.io/npm/dm/astro-matomo?logo=npm\u0026style=flat-square)\r\n![npm](https://img.shields.io/npm/v/astro-matomo?logo=npm\u0026style=flat-square)\r\n![GitHub package.json version](https://img.shields.io/github/package-json/v/felix-berlin/astro-matomo?label=github\u0026logo=github\u0026style=flat-square)\r\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/felix-berlin/astro-matomo/release.yml?label=release\u0026logo=github\u0026style=flat-square)\r\n\r\n## Installation\r\n\r\n```bash\r\npnpm add astro-matomo\r\n\r\nnpm install astro-matomo\r\n\r\nyarn add astro-matomo\r\n```\r\n\r\n## Options\r\n\r\n| Options            | Type                                    | Description                                                                                                                                                                                         |\r\n| ------------------ | --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\r\n| `enabled`          | `boolean`                               | Controls if the matomo script should be loaded                                                                                                                                                      |\r\n| `host`             | `string`                                | Url to your matomo installation                                                                                                                                                                     |\r\n| `siteId`           | `number`                                | Matomo site id.                                                                                                                                                                                     |\r\n| `heartBeatTimer?`  | `number`                                | If set the heart beat timer will be enabled                                                                                                                                                         |\r\n| `disableCookies?`  | `boolean`                               | If set cookies will be disabled                                                                                                                                                                     |\r\n| `preconnect?`      | `boolean`                               | Will create a preconnect link pointing to the matomo host                                                                                                                                           |\r\n| `setCookieDomain?` | `string`                                | Share the tracking cookie across multiple domains                                                                                                                                                   |\r\n| `trackerUrl?`      | `string`                                | Defaults to matomo.php                                                                                                                                                                              |\r\n| `srcUrl?`          | `string`                                | Defaults to matomo.js                                                                                                                                                                               |\r\n| `debug?`           | `boolean`                               | Activate debug mode                                                                                                                                                                                 |\r\n| `partytown?`       | `boolean`                               | Adds [Partytown](https://partytown.builder.io/) support. Matomo added as: `\u003cscript type=\"text/partytown\"\u003e...\u003c/script\u003e`                                                                              |\r\n| `crossOrigin?`     | `string`                                | Set `crossorigin` attribute                                                                                                                                                                         |\r\n| `viewTransition?`  | `boolean or { contentElement: string }` | If true Matomo works in \"SPA Mode\" and will track every page visit after `astro:page-load`. When you pass a selector to `contentElement` Matomo is able to track new media files, forms and content |\r\n\r\n## Example usage\r\n\r\n```js\r\n// astro.config.mjs\r\n\r\nimport { defineConfig } from 'astro/config';\r\nimport matomo from 'astro-matomo';\r\n\r\n// https://astro.build/config\r\nexport default defineConfig({\r\n  site: \"https://example.lol\",\r\n  integrations: [\r\n    matomo({\r\n      enabled: import.meta.env.PROD, // Only load in production\r\n      host: \"https://analytics.example.lol/\",\r\n      setCookieDomain: \"*.example.lol\",\r\n      trackerUrl: \"js/\", // defaults to matomo.php\r\n      srcUrl: \"js/\", // defaults to matomo.js\r\n      siteId: 666,\r\n      heartBeatTimer: 5,\r\n      disableCookies: true,\r\n      debug: false,\r\n      viewTransition: {\r\n        contentElement: \"main\"\r\n      }\r\n    }),\r\n  ]\r\n});\r\n\r\n```\r\n\r\n## Development\r\n\r\nGo to demo directory:\r\n\r\n```bash\r\ncd demo\r\n```\r\n\r\nGo to the demo project and install the dev package:\r\n\r\n```bash\r\npnpm install\r\n\r\nnpm install\r\n```\r\n\r\nStart the dev server:\r\n\r\n```bash\r\npnpm run dev\r\n\r\nnpm run dev\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelix-berlin%2Fastro-matomo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelix-berlin%2Fastro-matomo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelix-berlin%2Fastro-matomo/lists"}