Bolt

Add DataSaaS analytics to a project built with Bolt. Bolt generates full-stack apps with AI, so you can add tracking by providing a prompt in the chat.

1

Get your website ID and domain

Log in to your DataSaaS dashboard and go to your website settings. Copy your Website ID (starts with ds_) and your domain.

2

Send the installation prompt

Open your project in Bolt and paste the following prompt. Replace the placeholder values with your actual credentials:

Add DataSaaS analytics tracking to this project. Here's what needs to happen:

1. Add this script tag to the <head> section of the root HTML file or main layout component:

<script
  defer
  data-website-id="ds_YOUR_WEBSITE_ID"
  data-domain="yourdomain.com"
  src="https://datasaas.co/js/script.min.js"
></script>

2. Replace ds_YOUR_WEBSITE_ID with my actual website ID and yourdomain.com with my domain.

Framework-specific guidance:
- If this is a Vite/React project: add to index.html inside <head>
- If this is a Next.js project: use the next/script Script component in the root layout
- If this is an Astro project: add to the <head> in the base layout
- If this is a plain HTML project: add directly to <head>

The script handles SPA navigation automatically — no router integration needed.
3

Deploy and verify

After Bolt applies the changes, deploy your project using Bolt's publish feature. Visit your live site and check your DataSaaS dashboard to confirm events are being received.

Troubleshooting

If events aren't showing up, send this follow-up prompt in Bolt:

Can you verify the DataSaaS analytics setup?
1. What framework is this project using?
2. Where did you place the tracking script?
3. Will it load on all pages including future ones?
4. Show me the exact code where it's included.

Common issues

  • Script placed in a single page— The script needs to be in a layout or HTML file that loads on every page, not in an individual page component.
  • Wrong domain — The data-domain attribute must match your deployed site's domain exactly. Update it after deploying if the domain changes.
  • Modified script URL — Verify the src URL is https://datasaas.co/js/script.min.js. AI tools occasionally alter URLs.
  • Duplicate scripts— If you sent the prompt multiple times, check that the script wasn't added more than once.
Tip

DataSaaS automatically detects SPA navigation through the History API. No matter which framework Bolt uses for your project, page transitions are tracked without extra configuration.