Lovable
Add Loamly to your Lovable site
Lovable is an AI website builder that generates full React/Vite projects. This guide walks you through adding Loamly tracking to any Lovable project.
Add the tracking script
Since Lovable generates React/Vite projects, the tracking script goes in the index.html file.
Option 1: Project settings (recommended)
- Open your Lovable project
- Go to Project Settings
- Navigate to Custom Code
- Add the following script to the Head section:
<script
src="https://app.loamly.ai/t.js?d=yourdomain.com"
defer
></script>- Replace
yourdomain.comwith your actual domain - Click Save
Option 2: Edit index.html directly
- Open the file tree in your Lovable project
- Open
index.html - Add the script inside the
<head>tag:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My Lovable App</title>
<!-- Loamly tracking -->
<script
src="https://app.loamly.ai/t.js?d=yourdomain.com"
defer
></script>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>- Replace
yourdomain.comwith your actual domain
Custom domains
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 a preview of your Lovable project
- 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 preview, not the in-editor preview. The script only runs on published builds. |
| Domain mismatch | Ensure the domain in your script matches your deployed URL exactly (no www vs non-www mismatch) |
| Ad blocker | Try disabling ad blockers temporarily to verify |
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.