Skip to content

Frameworks and site builders

View as Markdown

Where to put the snippet in Next.js, React, Vue, SvelteKit, Angular, Astro, Laravel, Django, WordPress, AI app builders and other setups.

On this page

The snippet is a plain <script> tag, so it works anywhere you can edit the page <head>. Replace ws_your_tracking_id with the id from your dashboard.

Plain HTML

Paste the snippet before </head> on every page, or in the shared layout or template your pages use.

Next.js (App Router)

Add it to the root layout with next/script:

tsx
// app/layout.tsx
import Script from 'next/script';

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>
        {children}
        <Script
          src="https://reveata.com/js/script.js"
          data-website-id="ws_your_tracking_id"
          strategy="afterInteractive"
        />
      </body>
    </html>
  );
}

Client-side navigations are picked up automatically.

React, Vue, Svelte and other single-page apps

Put the snippet in the index.html that loads your app (for Vite projects, the index.html at the project root). The script follows route changes made through the History API by itself. If your router uses #/ URLs, add data-hash="true". Guides: React, React Router, Vue, SvelteKit, Angular.

PHP, Laravel, Django, Flask, FastAPI and Express

Add the snippet to the shared header, base template or layout that renders <head> for every page. Guides: PHP, Laravel, Django, Flask, FastAPI, Express. Each guide also shows how to proxy the script through your own domain and pass the visitor id with each checkout.

NGINX and Caddy

If you can’t edit the pages, the web server can add the snippet for you, and proxy the script and events through your own domain: see Install with NGINX and Install with Caddy.

Astro, Hugo, Jekyll, Eleventy and other static sites

Add the snippet to the base layout that renders <head> for every page.

WordPress

Use the Reveata plugin: it adds the script and shows your stats in wp-admin. Download it (version 0.4.0) and see Install on WordPress.

Webflow, Framer, Squarespace, Wix, Ghost and other builders

Paste the snippet into the site-wide custom code field for the head section. Step-by-step guides: Webflow, Framer, Wix, Squarespace, Ghost, Carrd, Bubble, Kajabi and Podia. Selling with Easytools checkouts? See Revenue from Easytools.

AI app builders

Apps made with Lovable, Bolt, v0 or Replit are regular web apps, so the snippet goes in the file that renders their <head>. Each guide has a prompt you can paste into the builder: Lovable, Bolt, v0, Replit.

Next.js, Nuxt, Astro, Gatsby, Docusaurus

The @reveata/next package has a component for Next.js and helpers for the others, as an alternative to the script tag above; each guide shows both. Guides: Next.js, Nuxt, Astro, Gatsby, Docusaurus.

Google Tag Manager

Use the Reveata Analytics tag template (download): see Install with Google Tag Manager. Tag managers can’t always keep the data-* attributes the script reads, so the template puts the settings in the script address instead (/js/script.js?website-id=ws_…); any loader can do the same.

Was this helpful?