To Keep It Going, Please Show Your Love.Buy Me a Coffee at


A simple Google analyics component for Svelte Runes project. Please follow the following steps to set it up.

Installation #

pnpm i -D runatics

.env #

Add your ANALYTICS_ID to .env


+layout.server.js #

Add the following code to +layout.server.js

import { ANALYTICS_ID } from '$env/static/private';
  /** @type {import('./$types').LayoutServerLoad} \*/
export async function load () {
return { ANALYTICS_ID };

+layout.svelte #

Add the following code to +layout.svelte

  import { Runatics } from 'runatics';
  let { children, data } = $props();
  const analyticsId = data.ANALYTICS_ID

<Runatics {analyticsId} />

{@render children()}

Technical information about this website