Integrations: Svelte

Svelte is a lightweight JavaScript framework for building web applications.

Monitor your traffic

Integrating MetricsWave with Svelte is easy. You only need to add the Script inside the <svelte:head> tag.

Something like this is enough.

  <!-- MetricsWave Script -->
  <script defer

It's important that this script should be included on all the pages of your application, maybe you can use a layout or extend the app from this component.

How to trigger events

To trigger events whenever you want you will need to use the API.

You have multiple options to do this, but a simple one it's to create a function like the next and use it everywhere in your application.

You only need to pass the trigger UUID and the parameters of your event.

export function triggerEvent(eventUuid: string, params: Object = {}) {
  if (!app.isProduction) {
    console.log(`[EventTracker] ${eventUuid}`, params)

  fetch(`${eventUuid}`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "Accept": "application/json",
    body: JSON.stringify(params),

← Go back to Documentation

Choose the plan
that fits your needs

Start for free, and upgrade your account at any moment.

All plans include:

  • 100% data ownership
  • Forever data retention
  • No cookie banner required
  • GDPR law compliance
  • Unlimited support
  • Cancel at any time
  • All features available