Documentation

Vercel v0

Add Loamly to your Vercel v0 site

Vercel v0 is an AI component builder that generates UI and deploys to Vercel. This guide walks you through adding Loamly tracking to a v0 project after deployment.

Add the tracking script

After generating your components with v0 and deploying to Vercel, add the tracking script based on your project type.

Next.js projects (recommended by v0)

If your v0 project deploys as a Next.js app, use the Next.js Script component in your root layout:

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

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
      <head>
        <Script
          src="https://app.loamly.ai/t.js?d=yourdomain.com"
          strategy="afterInteractive"
        />
      </head>
      <body>{children}</body>
    </html>
  );
}

Replace yourdomain.com with your actual domain.

Static HTML projects

If your project uses a plain index.html, add the script directly to the <head> tag:

<script
  src="https://app.loamly.ai/t.js?d=yourdomain.com"
  defer
></script>

Custom domains

If you have configured a custom domain on Vercel, use that domain in the script. Otherwise, use your .vercel.app subdomain.

Enable AI verification (recommended)

The client-side script tracks page views, but to unlock the full power of Loamly you need server-side setup. This enables AI bot crawl detection, RFC 9421 signature verification, bot-to-click temporal matching, and prompt-to-crawl correlation with your Intelligence data. Without it, you miss the connection between AI bots crawling your site and the humans who visit after.

See the AI Visitor Verification guide for setup instructions.

Verify installation

  1. Deploy your v0 project to Vercel
  2. Visit the deployed site in a new browser tab
  3. Open your Loamly dashboard
  4. Check the real-time visitors section
  5. Your visit should appear within seconds

Troubleshooting

IssueSolution
Not seeing visitsMake sure you are viewing the deployed Vercel site, not the v0 editor preview
Domain mismatchEnsure the domain in your script matches your Vercel deployment URL exactly (no www vs non-www mismatch)
Ad blockerTry disabling ad blockers temporarily to verify
Script not loading (Next.js)Make sure you are using the Script component from next/script, not a plain <script> tag

Debug mode

Open the browser console on your live site and run Loamly.debug(true) to enable verbose logging. This helps confirm the script is loading and sending data correctly.

Need help? Email hello@loamly.ai and we will get you set up.