Framework Guides

Ours Privacy Integration with Bolt.new

Step-by-step guide to integrate Ours Privacy, built for HIPAA-regulated workflows, with an app built in Bolt.new to track page views and custom events.

This guide covers adding Ours Privacy tracking to an app built with Bolt.new, an AI app builder that generates a full project you can edit and publish directly from the browser.

Integration Options

The guide below covers pasting the Ours Privacy Web SDK snippet directly into your project's HTML entry point.

For a no-code approach, use the Ours Privacy Tag Manager instead.


Steps to Integrate Ours with Bolt.new

1. Add the Web SDK snippet

  1. Copy your install snippet from the Install Ours page.
  2. In the Bolt.new editor, open index.html at the project root.
  3. Paste the snippet inside the <head> section, before the closing </head> tag.
<!-- index.html -->
<head>
  <!-- Ours Pixel Code -->
  <script>
    // your install code is here
  </script>
  <!-- End Ours Pixel Code -->
</head>

Important: Bolt.new publishes the last saved version of your files. Save index.html before clicking Publish, or the previous version ships without the snippet.

The Web SDK tracks page views automatically, both on initial load and on subsequent client-side route changes, so no additional routing code is required.

2. Publish and verify

  1. Save your changes and click Publish.
  2. Visit the published site and open the browser console to check for script errors.
  3. In your Ours account, check Recent Events to confirm page views are coming through.

Track Custom Events

Call window.ours('track', ...) from any component's event handler:

function SignUpButton() {
  const handleClick = () => {
    if (typeof window !== 'undefined' && window.ours) {
      window.ours('track', 'ButtonClicked', { button_name: 'sign_up' });
    }
  };

  return <button onClick={handleClick}>Sign Up</button>;
}

Next Steps

If you need further assistance, contact us at support@oursprivacy.com.

How is this guide?

On this page