@sinnwerkstatt/sveltekit-matomo
TypeScript icon, indicating that this package has built-in type declarations

0.0.8 • Public • Published

how to use

  1. include <Matomo /> in your +layout.svelte.
  2. configure it like so:
    <Matomo url="https://matomo.mysite.com" siteId={13} />
    
    or by defining environment variables:
    PUBLIC_MATOMO_URL="https://matomo.mysite.com"
    PUBLIC_MATOMO_SITE_ID=13
    see https://kit.svelte.dev/docs/modules#$env-dynamic-public for more information.
  3. 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>
    

Readme

Keywords

none

Package Sidebar

Install

npm i @sinnwerkstatt/sveltekit-matomo

Weekly Downloads

12

Version

0.0.8

License

AGPL-3.0-or-later

Unpacked Size

41.8 kB

Total Files

9

Last publish

Collaborators

  • andreas.nuesslein