Source: https://usedataowl.com/docs/lovable
Markdown source: https://usedataowl.com/docs/lovable.md
Description: Prompt-ready instructions to add realtime web analytics, Stripe revenue tracking, and JS error monitoring to apps built with Lovable, Bolt, and v0.

# Add Web Analytics & Error Tracking to Lovable, Bolt & v0 Apps

AI app builders change the code for you, so ask them to. Paste this prompt into the chat. Lovable and Bolt build Vite apps, so the script goes in `index.html`; v0 builds Next.js apps, so it goes in `app/layout.tsx`.

```text title="prompt"
Install the DataOwl analytics script on my website (example.com).

Load this script on every page, inside <head>:

<script
  defer
  data-website-id="YOUR_SITE_ID"
  src="https://usedataowl.com/js/script.cookies.js"
></script>

- Next.js: use next/script in the root layout with strategy="afterInteractive" and keep the data-website-id attribute.
- Plain HTML or a static site generator: add the tag to the shared layout or head template.
- Don't add it twice, and don't bundle it: it must load from the src URL above.

Optional goal tracking: call window.datasense?.("signup", { plan: "pro" }) after key actions, or add data-ds-goal="checkout" to a button.

This is the cookie script: it sets first-party datasense_vid and datasense_sid cookies so returning visitors are recognized. If the site has a cookie consent banner, list them there as analytics cookies.

Optional, only if I ask for it: for signed-in users, call window.datasense?.("identify", user.id, { name, email }) once they're signed in, and window.datasense?.("reset") on sign-out.
```

> Replace `YOUR_SITE_ID` with your site ID from the dashboard.

## Verify installation

After you deploy:

- Visit your live website.
- Open the **Realtime** page of your [DataOwl dashboard](/dashboard). Your visit shows up within a second, and the setup page says "Receiving events".

> DataOwl ignores localhost so you don't count your own development traffic. Add `data-allow-localhost="true"` to the tag to test locally. More options are in the [script configuration reference](/docs/script-configuration).
