← All guides

Next.js apps · ~3 min

Install on Next.js

Paste one Script tag in the root layout. In-app page changes are counted automatically.

Examples use Site ID yourdomain.com — replace with yours from onboarding or Settings.

  1. 01

    Add the script to your root layout

    Open app/layout.tsx and add this inside <body>. Publish, then visit the site once.

    import Script from "next/script";
    
    // inside <body>
    <Script
      src="https://revfast.app/tracker.js"
      strategy="afterInteractive"
      data-website-id="yourdomain.com"
      data-domain="yourdomain.com"
    />
  2. 02

    Prefer the JavaScript install instead?

    See the npm guide. It is the same tracker, started from a client component.

Install with AI

Paste into Cursor or Copilot — swap in your real Site ID first.

Add RevFast to this Next.js app. Connect key yourdomain.com, origin https://revfast.app. Prefer next/script in app/layout.tsx with tracker.js and data-website-id="yourdomain.com".

Related

Stuck? Email hello@revfast.app or open onboarding → Need help?