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
.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
- Deploy your v0 project to Vercel
- Visit the deployed site in a new browser tab
- Open your Loamly dashboard
- Check the real-time visitors section
- Your visit should appear within seconds
Troubleshooting
| Issue | Solution |
|---|---|
| Not seeing visits | Make sure you are viewing the deployed Vercel site, not the v0 editor preview |
| Domain mismatch | Ensure the domain in your script matches your Vercel deployment URL exactly (no www vs non-www mismatch) |
| Ad blocker | Try 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
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.