Skip to main content

Documentation Index

Fetch the complete documentation index at: https://revlytics.co/docs/llms.txt

Use this file to discover all available pages before exploring further.

SvelteKit

Add the script to your app.html:
src/app.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  %sveltekit.head%
  <script defer data-site="YOUR_SITE_ID" src="https://revlytics.co/script.js"></script>
</head>
<body>
  %sveltekit.body%
</body>
</html>

Svelte (Vite)

Add the script to your index.html:
index.html
<head>
  <script defer data-site="YOUR_SITE_ID" src="https://revlytics.co/script.js"></script>
</head>

Track events

<script>
  function handleClick() {
    window.revlytics?.track("button_click", { action: "subscribe" });
  }
</script>

<button on:click={handleClick}>Subscribe</button>
SvelteKit’s client-side routing is automatically detected.