# Lovable

### Add Humblytics Analytics to a Lovable Site

#### 1 · Sign up (or log in)

Visit [humblytics.com](https://docs.humblytics.com/) → **Start Free Trial**.\
Finish signup—or log in to your existing workspace.

***

#### 2 · Add your website in Humblytics

In the sidebar, click **Add Website**.

* **Domain** – enter your-domain.com (omit `https://` and `www`).
* **Site Name** – internal label (e.g. `Marketing-Prod`).\
  Copy the snippet in **Install Tracking Code**:

```html
<!-- Start Humblytics Tracking Code -->
<script async src="https://app.humblytics.com/hmbl.min.js?id=YOUR_SITE_ID"></script>
<!-- End Humblytics Tracking Code -->
```

Keep this tab open—we’ll return and click **Verify Website** once the tag is live.

***

#### 3 · Paste the script into your Lovable site

Since Lovable is a no-code/low-code AI-powered platform, you will need to inject the script such that it appears in the `<head>` section of your deployed pages.

**Steps:**

1. Open your project in Lovable.
2. Navigate to the site settings or global code injection section. (If Lovable doesn’t expose a “custom ” input field, you may need to edit the project’s code export or use a custom HTML component).
3. Paste the tracking snippet above into the global header area so it loads on all pages.

   ```html
   <!-- Start Humblytics Tracking Code -->
   <script async src="https://app.humblytics.com/hmbl.min.js?id=YOUR_SITE_ID"></script>
   <!-- End Humblytics Tracking Code -->
   ```
4. Save/publish your site on Lovable so the script becomes live.

**Tip:** Make sure the snippet is placed in—or injected into—the `<head>` section of every page you want to track. If you only place it on one page, only that page will send data.

***

#### 4 · Verify installation

Return to Humblytics and click **Verify Website** for your domain.\
Open your Lovable site in a private/incognito browser window and refresh once.\
Within \~30 seconds you should see a green **Verified** badge and live visitor count.

If verification fails, check:

* The script ID in the snippet matches the one issued for your domain.
* The domain you entered in Humblytics matches what the site is actually using (including subdomain vs root).
* The snippet is placed inside `<head>` and is not blocked by any site settings or by ad-blockers.

***

#### 5 · Explore & optimize

* **Dashboard** – see traffic, top pages, referrers.
* **Heatmaps** – automatically generated; reveal click hotspots and scroll depth.
* **Experiments** – run A/B tests without extra libraries (Experiments → **New Test**).
