Installation guides
Install on Bolt
On this page
Ask Bolt to add the tag, or paste it yourself in the code view, then publish the project.
Ask Bolt
Send this prompt in the chat
Replace
YOUR_SITE_IDwith the public site ID from your site's Settings → Install card. The site ID is public and safe in browser code; never put your secret key in a page.PromptAdd this analytics script to every page of the app. Load it once for the whole app, in index.html or the root layout (with next/script in a Next.js app), never from a single page or component. Keep the src and data-site-id attributes exactly as written: <script defer src="https://metricraven.com/js/script.js" data-site-id="YOUR_SITE_ID"></script>Publish
Publish the project, then open the published URL. The in-editor preview doesn't count.
Or edit the code
Open the code view
Choose the <> code icon at the top of the editor and pick the file from the file tree. Code editing isn't available on mobile, and is read-only in Safari.
Paste the tag into the page head
For a Vite project, that's
index.html, before</head>. For a Next.js project, follow the Next.js guide.index.html<script defer src="https://metricraven.com/js/script.js" data-site-id="YOUR_SITE_ID" ></script>Save and publish
Save the file and publish again.
Verify it works
Open your live website in a normal browser window (not an automated or embedded one). In the browser's Network panel, look for script.js and then a request to /api/v1/collect whose response contains ok: true. Open your site's Traffic tab and choose Refresh; the selected dates must include your visit.
Nothing showing? See Troubleshooting.
Notes
- Add the address your project is published on to your site's Settings → General → Site domains: a
*.bolt.hostaddress with Bolt hosting, a*.netlify.appaddress if you publish through Netlify, or your custom domain. Otherwise requests are refused withdomain_not_allowed. - AI edits can drift. After each publish, open your live app, view the page source and check the tag is still in
<head>with itsdata-site-idunchanged. - Click between a few pages and check the Network panel shows one
/api/v1/collectpageview per navigation. Two per click means the tag is loaded twice.
Optional script attributes are listed in Install & verify. To exclude your own visits, see Exclude your visits.