- include
<Matomo />
in your+layout.svelte
. - configure it like so:
or by defining environment variables:<Matomo url="https://matomo.mysite.com" siteId={13} />
see https://kit.svelte.dev/docs/modules#$env-dynamic-public for more information.PUBLIC_MATOMO_URL="https://matomo.mysite.com" PUBLIC_MATOMO_SITE_ID=13
- optional: track custom events like so:
<script lang="ts"> import { tracker } from "@sinnwerkstatt/sveltekit-matomo" function onSomeEvent() { if ($tracker) $tracker.trackEvent("my-cateogry", "my-action", "my-name") } </script>
@sinnwerkstatt/sveltekit-matomo
0.0.8 • Public • PublishedReadme
Keywords
nonePackage Sidebar
Install
npm i @sinnwerkstatt/sveltekit-matomo
Weekly Downloads
11
Version
0.0.8
License
AGPL-3.0-or-later
Unpacked Size
41.8 kB
Total Files
9