Analytics for Bolt.new Website: Step-by-Step Setup
Learn how to add analytics to your Bolt.new website. Compare Bolt Hosting native analytics, Google Analytics 4, and privacy-first tools.

, -
How to Add Analytics to Your Bolt.new Website (Step-by-Step)
What You Need Before Adding Analytics to a Bolt.new Site
Before you add any analytics to your Bolt.new project, you need a published live URL, not just a preview. Analytics scripts capture real traffic from real visitors, and a preview environment simply does not generate the kind of data you need for data-driven decisions. Publish first, then instrument.
With your site live, you have three paths forward: rely on Bolt Hosting's native analytics, bring in a third-party tool, or run both at the same time. That choice depends on your goals and your plan. Bolt Hosting on paid plans includes basic analytics covering unique visitors, pageviews, top pages, bandwidth usage, traffic sources, visitor locations, and a list of 404 pages. Free-tier users get none of that, so a third-party solution is not optional for them.
Here is what to gather before you start:
- Bolt Hosting analytics: No extra credentials needed; just a paid hosting plan and access to the project dashboard.
- [Litlyx](https://litlyx.com): A Project ID generated from your Litlyx account.
- Google Analytics 4: A G- Measurement ID from your GA4 property settings.
- Amplitude or PostHog: An API key or project token from each platform's settings page.
Something to keep in mind before you rely on those numbers: Bolt's built-in analytics currently includes visits and actions from web crawlers and bots, with no built-in way to separate that traffic from real human visits. That alone is a strong reason to pair native analytics with a Privacy-first analytics tool that filters noise and gives you cleaner, user-friendly insights from day one.
Step 1: Check Whether Bolt Hosting's Built-In Analytics Covers Your Needs
Bolt Hosting on paid plans includes native pageview analytics you can access directly from your project dashboard, with no third-party setup required. It covers the basics well, but it stops short of anything product teams or growth marketers would call actionable. Before adding an external tool, spend two minutes confirming whether what is already there is enough for your use case.
Where to Find the Analytics Tab in Bolt Hosting
Once your project is published to a paid Bolt Hosting plan, open the project dashboard and look for the Analytics tab in the top navigation. From there you get a focused view of traffic data with date-range controls. According to Bolt's official documentation, you can view data for the last 30 days using the Day, Week, or Month buttons in the top-right corner of the Analytics view.
The metrics visible in this view include unique visitors, pageviews, top pages, bandwidth usage, traffic sources, visitor locations, and a list of 404 pages. That is a solid snapshot for anyone who simply needs to confirm that traffic is arriving and which pages are pulling it in.
Limitations of the Built-In Option
Real constraints exist here. The built-in option gives you volume, not behavior. There are no event-level reports, no funnels, no retention curves, and no session replay. If your goal is to understand what users actually do after landing on a page, the built-in tab will leave you with unanswered questions.
There is also a data quality issue worth knowing about. Bolt's own documentation notes that analytics data currently includes visits and actions from web crawlers and bots, with no built-in way to separate that traffic from real human visits. As a rough traffic gauge, that is tolerable; when you need to make data-driven decisions about product direction, it falls short.
Marketers checking top-line numbers may find this sufficient. Developers and growth teams building anything beyond a brochure site will want to add a dedicated analytics layer on top.
Step 2: Choose the Right Analytics Tool for Your Bolt.new Project
Picking the right analytics tool shapes everything from your compliance posture to the depth of insights your team can act on. Four options cover most use cases for Bolt.new projects: Litlyx, Google Analytics 4, Amplitude, and PostHog. Each serves a different audience and requirement, so the choice comes down to your traffic geography, your team's technical depth, and how much behavioral data you actually need.
Litlyx: privacy-first, cookieless, GDPR-compliant
Litlyx is our top recommendation for teams serving EU audiences or anyone who wants privacy-first analytics without the compliance headache. Fully 100% GDPR-compliant, with no cookies, no personal data collected, and full EU hosting, it puts no banner between your visitors and your content. That matters because these banners routinely suppress measured traffic by double-digit percentages. Cookieless tracking also means your data is not fragmented by browser-level restrictions that increasingly block traditional client-side scripts. Setup is fast, the dashboard is clean, and you get user-friendly insights without wading through configuration options designed for enterprise data teams.
Google Analytics 4: familiar but consent-heavy
GA4 is the most widely deployed analytics platform on the web, and that familiarity has real value. Your team likely already knows the interface, and the free tier is generous. To add it to a Bolt.new project, you need a GA4 Measurement ID (starting with G-) from Google Analytics, then add the gtag.js script tag to your HTML head. Page view tracking fires automatically once the script is in place; custom events take one additional function call. For EU-based sites, the compliance burden is real: GA4 needs a consent management layer before it fires, which adds technical complexity and often suppresses the traffic numbers you see. GA4 also runs client-side, meaning privacy tools and strict browser settings can block it entirely, quietly undercounting real visits.
Amplitude and PostHog: product analytics options
If your Bolt.new project is a product rather than a marketing site, you likely need more than pageviews. Amplitude brings funnel analysis, retention charts, and Session Replay, and it can be added via a CDN snippet in the HTML head. PostHog is open-source, installs via npm as posthog-js, and ships with feature flags and A/B testing out of the box. Both tools require you to define custom events (button clicks, form submissions, page transitions) to realize their full value. They are well suited to product and growth teams who want to make data-driven decisions beyond simple traffic volume.
Step 3: How Do You Add Litlyx Analytics to a Bolt.new Website?
Adding Litlyx to a Bolt.new project takes roughly 30 seconds from account creation to live data. The process involves generating a Project ID, pasting one script tag into your HTML head, and publishing your site. Because Litlyx is 100% GDPR-compliant, uses no cookies, and collects no personal data, you skip the entire banner setup that other tools require.
Start by creating a free Litlyx account at litlyx.com. Once inside the dashboard, create a new project and copy the generated Project ID. Litlyx will display a ready-to-use script tag tied to that ID. That single line is everything you need.
Pasting the Script Tag in Bolt.new's File Editor
With your script tag copied, open your Bolt.new project. You have two routes here. The first is switching to Code view and finding your index.html or root layout file (React projects typically keep this as index.html at the project root, while Next.js or Remix scaffolds use a root layout.tsx). Paste the Litlyx script tag inside the <head> element, before the closing </head> tag.
The second route is faster. Use Bolt.new's AI chat directly. Paste a prompt like "Add this Litlyx script tag to the HTML head of my project" followed by your script snippet, and Bolt will locate the correct file and insert it for you. Bolt itself confirms you can either switch to Code view or use the chatbox to prompt Bolt to add the code for you.
For React or Vue apps built inside Bolt.new, you can also install Litlyx via npm:
Then initialize it in your app's entry point with your Project ID. This approach fits naturally into component-based projects and gives you access to the Litlyx JavaScript SDK for custom event tracking beyond pageviews.
One key benefit is worth spelling out clearly: because Litlyx uses cookieless tracking and collects no personal information, no banner is required. Visitors land on your page and see your content immediately, with no pop-up creating friction. That keeps bounce rates lower and your measured data cleaner.
Verifying Real-Time Data in the Litlyx Dashboard
After pasting the script, publish your Bolt.new project to a live URL. Do not test inside the preview environment since analytics only fires on the published domain. Once the live URL is active, open a new browser tab, visit your site, then return to the Litlyx dashboard.
The real-time view updates within seconds. You should see your visit appear almost immediately, confirming the integration is working. If nothing appears after a minute, double-check that the script is inside <head> and not placed in <body>, and confirm you are visiting the published URL rather than a local preview. User-friendly insights like this real-time feedback loop make it easy to catch integration issues before real traffic arrives.
From this point, Litlyx begins collecting pageviews, referrer sources, device types, and geographic data without any personal identifiers attached. Your analytics for your Bolt.new website are live, privacy-first, and ready for data-driven decisions.
Step 4: How Do You Add Google Analytics 4 to a Bolt.new App?
Adding GA4 to a Bolt.new site takes only a few minutes, but there are compliance and accuracy trade-offs worth understanding before you commit. You need a Measurement ID, one script snippet, and a clear plan for how you handle EU visitors.
Getting Your G- Measurement ID
Start inside your Google Analytics account. Create a new property (or open an existing one), go to Admin, then Data Streams, and select your web stream. Your Measurement ID appears at the top right of that screen in the format G-XXXXXXXXXX. Copy it exactly; a single character error means zero data ever appears in your reports.
Keep this ID handy. You will paste it directly into the script tag in the next step, and you will also need it if you ever switch to a server-side setup or a tag manager layer later.
Injecting gtag.js via Bolt.new's Editor
Once you have your ID, open your Bolt.new project and switch to Code view. Paste the standard gtag.js snippet into the <head> section of your root HTML file, replacing G-XXXXXXXXXX with your real Measurement ID. As confirmed by Rapidevelopers, page view tracking is automatic once the script is installed, and custom events require only a single function call on top of that.
For framework-based projects scaffolded inside Bolt.new (React, Vue, and similar), you can install a GA4 npm package instead and initialize it in your app entry file. Both approaches work, though the HTML head method is faster to ship.
Honestly, one practical detail trips up a lot of teams here. GA4 runs entirely in the browser, which means privacy tools, strict browser settings, and script blockers can prevent it from firing at all, leading to undercounted traffic on audiences that skew toward privacy-conscious users. Beyond accuracy, EU-based sites need a consent mechanism in place before GA4 fires, since the tool collects personal data and falls under GDPR. Implementing that consent layer properly often reduces measured traffic significantly, because users who decline are simply not counted. If your audience is primarily in the EU, a cookieless tracking approach like Litlyx avoids this problem entirely by collecting no personal data at all.
Step 5: How Do You Add Amplitude or PostHog for Event-Level Tracking?
Both Amplitude and PostHog give you event-level visibility that goes well beyond simple pageview counts. If your Bolt.new project needs funnels, retention curves, or behavioral data, either of these tools is a practical next step.
Adding Amplitude to Your Bolt.new Project
Amplitude can be added via a CDN snippet pasted into the HTML head or through the Amplitude Wizard CLI for Node-based Bolt.new projects. The CDN approach is the faster path: copy the snippet from Amplitude's quickstart guide, open your index.html in Bolt.new's file editor, and paste it inside the <head> tag. Once the script loads, Amplitude automatically captures pageviews. To get real value, you need to go further and define custom events, such as button clicks, form submissions, and page transitions, using amplitude.track('event_name', { properties }).
Adding PostHog to Your Bolt.new Project
PostHog is installed via npm (posthog-js) and initialized with a project API key, and it supports feature flags and A/B tests natively. For a React or Vue app scaffolded inside Bolt.new, run npm install posthog-js, then initialize it in your root component with your project API key and host URL. PostHog's auto-capture picks up clicks and form interactions out of the box, though you will still want to define named events for anything business-critical.
Key steps for both tools:
- Define at least three to five custom events before launch so you have meaningful data from day one.
- Pass user properties only if your privacy policy and GDPR obligations allow it.
- Test each event in the tool's live event stream before publishing.
Using Bolt.new's AI Prompt to Scaffold the Integration
Look, you do not need to write initialization code from scratch. Open Bolt.new's AI chat and type something like: "Add PostHog analytics to this project using API key YOUR_KEY_HERE and initialize it in the root layout." Bolt will generate the correct import, initialization block, and placement. The same approach works for Amplitude. Review the output before accepting it, confirm the API key placeholder is replaced with your real key, and then publish. This workflow cuts setup time considerably and reduces the chance of a syntax error breaking your head section.
Step 6: Verify Your Analytics Is Firing Correctly
Verification is the step most teams skip, and it costs them days of missing data. Once you have added your analytics script, publish the Bolt.new project to its live URL and wait a minute or two for the deployment to propagate before you run any tests. A preview environment will not reliably record real traffic, so this step matters.
After the live URL is active, visit it from a browser tab and switch immediately to your analytics platform's real-time view. For Litlyx, the real-time dashboard updates within seconds and requires no browser extensions or developer tools to confirm the signal arrived. The simplicity here is part of what makes it a strong choice for teams that want user-friendly insights without a complicated verification workflow.
For GA4, the process involves a couple more steps. Open the DebugView inside your Google Analytics property and check the browser's Network tab to confirm that gtag requests are actually being sent. Keep in mind that GA4 runs in the user's browser, which means privacy tools and certain browser settings can block those requests silently, making verification all the more important.
A quick checklist for any tool:
- Visit the live URL, not the Bolt preview
- Open the platform's real-time or live view
- Confirm at least one pageview event appears within 30 seconds
- Re-deploy if nothing arrives, then check whether the script tag survived the rebuild
One final note: Bolt's built-in analytics currently includes bot and crawler traffic with no way to filter it out, so do not treat high early numbers as a clean signal of real human visits.
What Are the Most Common Mistakes When Setting Up Analytics on Bolt.new?
The most common setup mistakes are testing in a preview environment instead of a live URL, placing scripts in the wrong part of the HTML, and skipping GDPR compliance steps for GA4. Each of these can leave you with missing data, legal exposure, or a silent analytics integration you think is working but is not.
Testing in preview instead of publishing first. Bolt.new's preview environment does not represent real traffic. Any analytics script you paste will appear to run, but no genuine user sessions are captured. Always publish your project to a live URL and visit that URL before you declare the integration working.
Putting the script in the body instead of the head. Analytics scripts belong in the <head> of your HTML document. Placing them in the body means the page can partially render before the script loads, which causes missed pageview fires on fast connections and dropped events on slow ones. This is especially common when using Bolt's AI chat to inject code, since the prompt has to be specific about placement.
Running GA4 without a consent mechanism for EU visitors. Bolt's own documentation notes you can add third-party services like Google Analytics by embedding their script, but it does not handle GDPR compliance for you. GA4 fires on load by default, which creates real legal risk for EU audiences. If you need GDPR-compliant analytics without that overhead, Litlyx uses cookieless tracking and collects no personal information, so no banner is required.
Expecting built-in analytics on a free plan. Bolt Hosting's native analytics tab only appears on paid plans. Free-tier projects simply will not show the tab, and many users spend time looking for a setting that does not exist at that tier.
Skipping re-verification after each re-deploy. Some Bolt.new project configurations regenerate the index.html head on rebuild, which can silently remove a manually pasted script. Make it a habit to confirm your analytics dashboard receives a fresh event after every deploy, not just the first one., -
Frequently asked questions
Does Bolt.new have built-in analytics?
Yes, Bolt Hosting on paid plans includes native analytics accessible from your project dashboard. It covers unique visitors, pageviews, top pages, bandwidth usage, traffic sources, visitor locations, and 404 pages. However, free-tier users get no built-in analytics. The native option lacks event-level reports, funnels, retention curves, and session replay—features needed for deeper behavioral insights.
Is Bolt.new analytics available on the free plan?
No. Built-in analytics is exclusive to paid Bolt Hosting plans. Free-tier users must use a third-party analytics tool like Litlyx, Google Analytics 4, Amplitude, or PostHog to track visitor data. This makes a third-party solution mandatory rather than optional for free plan users.
Can I use Google Analytics 4 with Bolt.new?
Yes. Add your GA4 Measurement ID (starting with G-) by inserting the gtag.js script tag into your Bolt.new project's HTML head. Pageview tracking fires automatically; custom events require one additional function call. Note: GA4 requires a consent management layer for EU compliance, adding technical complexity and often suppressing tracked traffic.
What is the easiest GDPR-compliant analytics tool for Bolt.new?
Litlyx is the top recommendation for GDPR compliance. It's 100% GDPR-compliant, fully cookieless, collects no personal data, and offers EU hosting. No consent banner needed, which eliminates the traffic suppression that banners typically cause. Setup is fast, the dashboard is user-friendly, and it filters bot traffic automatically.
Does Litlyx work with Bolt.new projects?
Yes. Litlyx integrates with Bolt.new by adding a script tag to your project. You'll need a Project ID from your Litlyx account, then paste the tracking script into your Bolt.new HTML. It's privacy-first, cookieless, and GDPR-compliant—ideal for EU audiences or anyone avoiding consent banner complexity.
How do I add a script tag in Bolt.new's editor?
Open your Bolt.new project editor and locate the HTML head section. Paste your analytics script tag (from Litlyx, GA4, or another tool) directly into the head. For GA4, use the gtag.js script; for Litlyx, use the project-specific tracking script. Save your changes, then publish to a live URL for tracking to begin.
Will analytics scripts survive a Bolt.new re-deploy?
Yes, analytics scripts added directly to your Bolt.new project HTML will persist through re-deploys. They're part of your project code, not temporary additions. However, always verify after deployment that tracking is firing correctly by checking your analytics dashboard for incoming data.
Can I track custom events on a Bolt.new app?
Yes, with GA4 and similar platforms. GA4 custom events require adding a function call in your JavaScript code. Litlyx also supports event tracking through its API. PostHog and Amplitude offer similar capabilities. Built-in Bolt Hosting analytics does not support custom events—only pageviews and basic traffic metrics.
Does cookieless analytics work on Bolt.new hosted sites?
Yes. Litlyx is fully cookieless and works seamlessly on Bolt.new. Cookieless tracking avoids browser-level restrictions that block traditional scripts and eliminates the need for consent banners. This approach improves data accuracy and user experience, especially for EU-based audiences.
What analytics tools does Bolt.new officially support?
Bolt.new doesn't officially restrict third-party tools. Any analytics platform accepting a script tag—Litlyx, Google Analytics 4, Amplitude, PostHog, and others—integrates via HTML insertion. Bolt Hosting provides native analytics on paid plans. For best results, choose tools compatible with your compliance needs and traffic geography.