Documentation

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)

  1. Open your Lovable project
  2. Go to Project Settings
  3. Navigate to Custom Code
  4. Add the following script to the Head section:
<script
  src="https://app.loamly.ai/t.js?d=yourdomain.com"
  defer
></script>
  1. Replace yourdomain.com with your actual domain
  2. Click Save

Option 2: Edit index.html directly

  1. Open the file tree in your Lovable project
  2. Open index.html
  3. 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>
  1. Replace yourdomain.com with your actual domain

Custom domains

If you use a custom domain with your Lovable project, use that domain in the script. If you are using a Lovable subdomain, use that instead.

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 a preview of your Lovable project
  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 preview, not the in-editor preview. The script only runs on published builds.
Domain mismatchEnsure the domain in your script matches your deployed URL exactly (no www vs non-www mismatch)
Ad blockerTry disabling ad blockers temporarily to verify

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.