Install guides / Tools & AI builders

Add PageLens analytics to Lovable, Bolt & v0

PageLens is cookieless website analytics: no consent banner, a script under 4 KB, real-time stats, funnels, session replay and AI-traffic insights. Setup on Lovable, Bolt & v0 takes about two minutes.

Steps

  1. Open your project chat in Lovable, Bolt or v0.
  2. Paste the prompt below (replace YOUR_SITE_ID with the id from your PageLens site settings).
  3. Publish the app and open it: your visit appears in PageLens within seconds.
Add PageLens analytics to this app.

Insert this script into the <head> of every page, using the framework's own mechanism for global head tags (Next.js: next/script with strategy="afterInteractive" in the root layout; Vite/React: index.html):

<script defer src="https://app.pagelens.io/script.js" data-site-id="YOUR_SITE_ID"></script>

PageLens is cookieless: do not add a cookie banner or consent logic for it.
Pageviews and route changes are tracked automatically.
For key actions (sign up, purchase) call window.pagelens?.track('event_name', { optional: 'props' }).

Replace YOUR_SITE_ID with the id from your site settings in PageLens. The dashboard shows the exact snippet with your id filled in.

Check that it works

Open your site in a new tab, then open PageLens. The live counter shows your visit within a few seconds. Visits from localhost are ignored by default.

Track custom events

Add data-pagelens-event to any button or form, or call the JavaScript API:

<button data-pagelens-event="signup" data-pagelens-prop-plan="pro">Start trial</button>

<script>
  window.pagelens?.track('signup', { plan: 'pro' })
</script>

You can also turn on autocapture for button clicks, form submissions and copy events in Site Settings → Tracking. No code is needed.

Avoid ad blockers

Some ad blockers drop requests to analytics domains. Serve PageLens from your own domain to count those visits too.

Don't have a site ID yet?

Create a free PageLens account: 7-day trial, no card, no cookie banner needed.

Start free trial

Questions

Do I need a cookie banner for analytics on Lovable, Bolt & v0?

PageLens sets no cookies and stores nothing in the visitor's browser, so it doesn't need a cookie banner of its own. Other scripts on your site may still need one, so check what else you load.

Will it slow down my Lovable, Bolt & v0 site?

The script is under 4 KB and loads with defer, after your page content. It doesn't block rendering.

Can I use it together with Google Analytics?

Yes. PageLens runs next to Google Analytics or any other tool on your Lovable, Bolt & v0 site, so you can compare the numbers before you switch.

How do I see visitors from ChatGPT on my Lovable, Bolt & v0 site?

Visits that come from ChatGPT, Claude, Perplexity and other AI assistants appear as their own channel in your traffic sources, with no setup. To also see which pages AI crawlers read, add a small server snippet or the PageLens Cloudflare Worker: crawlers don't run JavaScript, so only your server sees them.

What does it cost?

There is a 7-day free trial without a card. Plans start at $5 a month.

Other tools & ai builders

Google Tag Manager