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.

Installation

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>

Vue Router

Revlytics automatically detects Vue Router navigation. No additional configuration is needed.

Track custom events

components/SignupForm.vue
<script setup>
function handleSubmit() {
  window.revlytics?.track("signup_completed", {
    method: "email",
  });
}
</script>

<template>
  <form @submit.prevent="handleSubmit">
    <input type="email" placeholder="Email" />
    <button type="submit">Sign Up</button>
  </form>
</template>

Composable (optional)

Create a reusable composable for cleaner usage:
composables/useRevlytics.ts
export function useRevlytics() {
  const track = (event: string, props?: Record<string, unknown>) => {
    window.revlytics?.track(event, props);
  };

  const identify = (userId: string, traits?: Record<string, unknown>) => {
    window.revlytics?.identify(userId, traits);
  };

  return { track, identify };
}