All install guides

Install on Next.js

Use next/script in your root layout. The script is about 6 KB gzipped and loads asynchronously, so it won't hold up your pages.

1. Get your tracking ID

Create a free account, then add your site in the dashboard. It shows the snippet below with your own tracking ID filled in; the ID here is only an example.

2. The snippet

// app/layout.tsx (App Router)
import Script from 'next/script';

// inside <body> of the root layout:
<Script src="https://api.thravic.com/tf.js" data-tracking-id="TF-1A2B3C4D" strategy="afterInteractive" />

3. Add it

  1. App Router: add the <Script> above inside <body> of app/layout.tsx, once.
  2. Pages Router: paste the plain HTML snippet (HTML tab) inside <Head> in pages/_document.tsx instead.
  3. Commit and deploy your changes.
  4. In your Thravic dashboard, open the site and click Verify Installation.

Data appears within a few minutes of your first visitor. Form inputs are masked in the browser before anything is sent.

Other platforms

WordPress · Shopify · Wix · Squarespace · Webflow · Framer · Ghost · Carrd · Bubble · Blogger · Joomla · Drupal · Tag Manager · AI agent · Other / HTML · React Native and Expo