Skip to content
Back to Blog
5 min readVibePing Team

How to Add Analytics to a Lovable App in 60 Seconds

A step-by-step guide to adding analytics, error tracking, and web vitals monitoring to your Lovable app — with a single script tag.

You built something in Lovable. It's live. People are signing up. But you have no idea what they're doing once they land on the page — which buttons they click, where they drop off, or whether your app is throwing errors on their devices.

Let's fix that. Here's how to add analytics, error tracking, and web vitals monitoring to your Lovable app with a single script tag using VibePing.

Total time: about 60 seconds.

What You'll Get

Before we start, here's what VibePing auto-captures the moment the script loads:

  • Pageviews — every route change, including SPA navigation
  • Errors with full stack traces — unhandled exceptions, promise rejections, network failures
  • Web Vitals — LCP (Largest Contentful Paint), CLS (Cumulative Layout Shift), FID (First Input Delay)
  • Sessions — unique visitors, session duration, bounce rate

No config. No extra code. It all starts flowing the second the SDK loads.

Step 1: Create a VibePing Account

Head to app.vibeping.dev and sign up. You can use Google or email — takes about 10 seconds.

Once you're in, create a new project. Give it a name that matches your Lovable app (e.g., "my-saas-app" or "client-portal"). Hit create.

Step 2: Copy Your Project ID

After creating the project, you'll see your project ID on the dashboard. It looks like this:

vp_abc123def456

Copy it. You'll need it in the next step.

Step 3: Add the Script Tag to Your Lovable App

This is where the magic happens. Open your Lovable project and follow these steps:

  1. In the Lovable editor, click Settings (the gear icon in the sidebar)
  2. Scroll down to Custom Code or Head Code section
  3. Paste this script tag:
<script
  src="https://cdn.jsdelivr.net/npm/@vibeping/sdk/dist/vibeping.umd.js"
  data-id="vp_YOUR_PROJECT_ID"
></script>

Replace vp_YOUR_PROJECT_ID with the project ID you copied in Step 2.

  1. Save and redeploy your Lovable app.

That's it. The SDK is now loaded on every page of your app.

Alternative: Add It Directly in Code

If you prefer working in Lovable's code view, you can drop the script tag into your index.html file inside the <head> tag:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>My App</title>
    <!-- VibePing Analytics -->
    <script
      src="https://cdn.jsdelivr.net/npm/@vibeping/sdk/dist/vibeping.umd.js"
      data-id="vp_YOUR_PROJECT_ID"
    ></script>
  </head>
  <body>
    <!-- ... -->
  </body>
</html>

Either approach works. Pick whichever feels more natural for your workflow.

Step 4: Watch Data Flow In

Go back to your VibePing dashboard at app.vibeping.dev. Open your project. Within a few seconds of someone visiting your app, you'll see:

  • A live feed of pageviews
  • Web vitals scores for each visit
  • Any errors that fire, with stack traces attached

Open your Lovable app in another tab, click around, and you'll see the events appear in real time.

Tracking Custom Events for Funnels

Pageviews and errors are useful, but you probably want to track specific actions — signups, purchases, feature usage. VibePing exposes a global vibeping object you can call from anywhere in your code.

vibeping.track('signup_completed', { method: 'google' })
vibeping.track('plan_upgraded', { plan: 'pro', price: 29 })
vibeping.track('feature_used', { feature: 'export_csv' })

In Lovable, you'd add these calls inside your event handlers. For example, after a successful signup:

const handleSignup = async (provider) => {
  await signUpWithProvider(provider)
  vibeping.track('signup_completed', { method: provider })
}

These events show up in your VibePing dashboard under the Events tab. You can filter by event name, see counts over time, and build a picture of your conversion funnel — from first visit to signup to paid conversion.

This is where Lovable app analytics gets interesting. Instead of guessing which features matter, you'll have hard data on what users do after they sign up.

Why Not Google Analytics?

You could add GA4 to your Lovable app. But here's the thing: GA4 doesn't capture errors. It doesn't track web vitals by default. It doesn't give you stack traces. And the interface requires a PhD in data analytics to navigate.

VibePing is built for developers who ship with tools like Lovable. One script tag gives you analytics, error tracking, and performance monitoring in a single dashboard. No tag manager. No extra setup.

AI-Powered Debugging

Here's where VibePing goes beyond standard analytics.

Error Explainer

When your Lovable app throws an error in production, VibePing captures the full stack trace and runs it through an AI explainer. You get:

  • A plain-English description of what went wrong
  • The likely root cause
  • Suggested fixes you can paste back into Lovable

No more Googling cryptic error messages. The AI has context about your error — the browser, the page, the stack trace — and gives you a targeted explanation.

Health Score

Every project gets a health score from 0 to 100, calculated from your error rate, web vitals, and uptime. It updates in real time. If your score drops after a deploy, you know something broke — and you can drill into exactly what changed.

This is Lovable.dev monitoring that doesn't require you to stitch together three different tools. One dashboard, one script tag, full visibility.

Quick Recap

Here's the whole process:

  1. Sign up at app.vibeping.dev
  2. Create a project and grab your project ID
  3. Paste the script tag into your Lovable app's custom code section
  4. Deploy and start seeing data

From there, add vibeping.track() calls for the events that matter to your business. Use the AI error explainer when things break. Keep an eye on your health score after each deploy.

You built your app fast with Lovable. Now you can understand your users without slowing down.