Google analytics for svelte-kit
Install @sajuthankappan/sveltekit-google-analytics
npm i @sajuthankappan/sveltekit-google-analytics
In your svelte component (say, __layout.svelte)
<script>
import GoogleAnalytics from '@sajuthankappan/sveltekit-google-analytics';
import { page } from '$app/stores';
const gaKey = import.meta.env.VITE_GA_KEY;
</script>
<GoogleAnalytics {page} key={gaKey}/>
npm run package
npm publish ./package --access public
Note: Publishing to be done only by the npm package owner.