Lovable × Google Analytics × MCP

Your Lovable app needs a dashboard.

Lovable builds your app. anacraft gives you the numbers — who is visiting, what they look at, where they come from. Add GA4 to your Lovable project in one prompt, then ask your AI assistant anything. The data is real, the answers are instant, and you never leave the conversation.

The problem

Lovable builds apps. But who is using them?

You described an app, Lovable built it, and it is live. Now you need to know if anyone showed up. The GA4 console works, but it is a different tab, a different login, and a different language from where you are already working.

Lovable
builds the app
+plus
anacraft
reads the analytics
=equals
Full picture
build + insights, one workflow
Setup

Nothing to install. Your tag in the clipboard.

Open anacraft.dev/app, sign in with Google, pick or create the GA4 property for your app, and copy the block that goes into Lovable. Nothing to read, four things to click, nothing on your machine. Rather run it yourself? The same page is craft serve on your own machine, and every endpoint behind it is written down.

01

Open anacraft.dev/app and sign in

Sign in with Google. It asks for two Analytics permissions — one to read your numbers, one to create the property for your app — so leave both ticked.

Open anacraft.dev/app →

Your Google sign-in is held in that browser tab only: closing it, or an hour, forgets it.

02

Pick your app's property, or make one

Making one is the usual answer for a Lovable app: give it the app's URL and anacraft creates the property and its web stream, then hands you the measurement ID with the tag already written around it. A site that already has a property is reused, not duplicated.

The page anacraft.dev/app shows: a measurement ID in gold, the tag written out below it, and a button that copies it.

It is part of Anacrafter Elite — $9.99 a month, the same plan step 04 needs — and the page takes you through subscribing without leaving the flow. Prefer your own machine? craft serve runs the same page locally, and craft serve --demo walks it first, creating nothing.

03

Paste it into Lovable

The copy button gives you instructions, not just a snippet — written for the agent that built the app. Paste it into the Lovable chat, send, and publish.

you: Add Google Analytics 4 to this app. Paste this tag into index.html as the last thing inside <head>, exactly as written, with MEASUREMENT_ID replaced by the measurement ID below: <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=MEASUREMENT_ID"></script> … The measurement ID is "G-" followed by "1A2BCD345E", joined with no space. It is split in two only so this chat does not hide it as a key: it is a public ID, not a secret. Rules: - Do not install an analytics npm package or a React wrapper. - If the project already has a Google Analytics tag, replace it. - Do not send your own page_view on route changes.

Those rules are there because an agent will otherwise improve on a tag it is handed: an npm wrapper instead of the snippet, a second tag beside the first, or a page view on every route change that GA4 was already counting. Each one quietly doubles or hides your numbers. The ID comes in two pieces because Lovable treats a pasted G- ID as an API key and hides it from the agent as a secret, and a tag without its ID measures nothing.

Publish, then craft live to watch the first visit land.

04

Wire it into your assistant

This is the one step that installs something: craft, which serves your numbers to the assistant from your own machine. Sign in, pick your app's property, and write it into Claude Desktop's config.

curl -fsSL https://anacraft.dev/install.sh | bash craft login craft use <property id> craft mcp --install # Claude Code claude mcp add anacraft -- craft mcp

Restart the client and ask it how the app is doing. Cursor, Windsurf, VS Code and the raw JSON are on the MCP page.

05

Ask

you: how is the site doing this week? assistant: [calls site_status — reads GA4] assistant: 12,481 users this week, up 9% from last week. Sessions grew 7% to 18,203. Bounce rate improved to 41.2%. you: what pages are people looking at? assistant: [calls list_pages] assistant: Top pages: / (6,714), /pricing (3,917), /docs/quickstart (2,765), /blog (2,136).

Want to see it before you commit?

craft serve --demo walks the whole page on synthetic data, creating nothing, and craft mcp --demo does the same for the assistant — no Google account, no subscription. One Elite plan covers both when you are ready for real numbers.

Tools

Every question, answered.

anacraft exposes these tools to your AI client. All are read-only. All carry the date window they cover. All work with the property you configured.

📈

Site status

Users, sessions, page views, key events, bounce rate, and session duration — with deltas and a daily trend. The "how are we doing" call.

🟢

Live visitors

Who is on the site right now, by country. Realtime, polled every 10 seconds.

📄

Top pages

Most-visited pages ranked by views.

🎯

Top events

Events ranked by count, with the previous period for comparison.

🔗

Traffic sources

Source / medium pairs ranked by sessions.

🌍

Countries

Users by country, ranked.

🔍

Search

Filter pages or events by a substring — "/blog", "purchase", "signup".

⚙️

Properties

Switch between GA4 properties without leaving the conversation.

Multiple projects

More than one Lovable app?

Each Lovable project gets its own GA4 property. anacraft reads all of them — switch between properties by name or ID without restarting anything.

you: switch to the booking app assistant: [calls list_properties] assistant: Found: "My SaaS" (397412345), "Booking App" (397890123), "Portfolio" (397654321). Switching to Booking App. you: how is it doing? assistant: [calls site_status — reads the booking app's GA4]
Bonus

Also a terminal dashboard.

anacraft is not just an MCP server. Run craft dash in any terminal for a full-screen, live-updating dashboard with ore-textured bars, sparklines, and achievement toasts when the numbers move.

craft dash # live dashboard for the default property craft dash --demo # synthetic data, no account needed craft overview --format json # one-shot, scriptable

Start mining your metrics.

Sign in, give your Lovable app its GA4 property, and ask your assistant anything about your traffic.