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 tag to your index.html:
public/index.html
<head>
  <script defer data-site="YOUR_SITE_ID" src="https://revlytics.co/script.js"></script>
</head>

React Router / SPA

Revlytics automatically detects client-side navigation via pushState and popstate. No extra setup is needed for React Router, TanStack Router, or any other client-side router.

Track custom events

function PricingCard({ plan }) {
  const handleSelect = () => {
    window.revlytics?.track("plan_selected", {
      plan: plan.name,
      price: plan.price,
    });
  };

  return (
    <div>
      <h3>{plan.name}</h3>
      <button onClick={handleSelect}>Select Plan</button>
    </div>
  );
}

HTML attribute tracking

You can also track events declaratively without JavaScript:
<button
  data-revlytics-event="cta_click"
  data-revlytics-prop-location="hero"
>
  Get Started
</button>

Vite / Create React App

Both work the same way — add the script to index.html in the public directory.