# Frameworks and site builders

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

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](https://reveata.com/docs/react), [React Router](https://reveata.com/docs/react-router), [Vue](https://reveata.com/docs/vue), [SvelteKit](https://reveata.com/docs/sveltekit), [Angular](https://reveata.com/docs/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](https://reveata.com/docs/php), [Laravel](https://reveata.com/docs/laravel), [Django](https://reveata.com/docs/django), [Flask](https://reveata.com/docs/flask), [FastAPI](https://reveata.com/docs/fastapi), [Express](https://reveata.com/docs/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](https://reveata.com/docs/nginx) and [Install with Caddy](https://reveata.com/docs/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](https://reveata.com/downloads/reveata-wordpress.zip) (version 0.4.0) and see [Install on WordPress](https://reveata.com/docs/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](https://reveata.com/docs/webflow), [Framer](https://reveata.com/docs/framer), [Wix](https://reveata.com/docs/wix), [Squarespace](https://reveata.com/docs/squarespace), [Ghost](https://reveata.com/docs/ghost), [Carrd](https://reveata.com/docs/carrd), [Bubble](https://reveata.com/docs/bubble), [Kajabi](https://reveata.com/docs/kajabi) and [Podia](https://reveata.com/docs/podia). Selling with Easytools checkouts? See [Revenue from Easytools](https://reveata.com/docs/easytool).

## 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](https://reveata.com/docs/lovable), [Bolt](https://reveata.com/docs/bolt), [v0](https://reveata.com/docs/v0), [Replit](https://reveata.com/docs/replit).

## Next.js, Nuxt, Astro, Gatsby, Docusaurus

The [`@reveata/next` package](https://reveata.com/docs/npm-packages) 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](https://reveata.com/docs/nextjs), [Nuxt](https://reveata.com/docs/nuxt), [Astro](https://reveata.com/docs/astro), [Gatsby](https://reveata.com/docs/gatsby), [Docusaurus](https://reveata.com/docs/docusaurus).

## Google Tag Manager

Use the Reveata Analytics tag template ([download](https://reveata.com/downloads/reveata-gtm-template.tpl)): see [Install with Google Tag Manager](https://reveata.com/docs/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.
