Framework Guides

Ours Privacy Integration with v0

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

This guide covers adding Ours Privacy tracking to an app built with v0, Vercel's AI tool for generating React and Next.js UI. v0 output is a standard Next.js project, so the same integration as any other Next.js app applies once you export it.

Integration Options

The guide below covers using the Ours Privacy Web SDK inside the exported Next.js project.

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


Steps to Integrate Ours with v0

1. Export your v0 project

In v0, use Add to Codebase (or download the generated code) to bring the project into a Next.js repository you own and deploy.

2. Install the Web SDK

npm install @oursprivacy/cdp-sdk
// components/providers/analytics-provider.tsx
'use client';
import { useEffect } from 'react';
import ours from '@oursprivacy/cdp-sdk';

export function AnalyticsProvider() {
  useEffect(() => {
    ours.init('YOUR_SITE_ID', { track_web_events: true });
  }, []);

  return null;
}
// app/layout.tsx
import { AnalyticsProvider } from '@/components/providers/analytics-provider';

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <body>
        {children}
        <AnalyticsProvider />
      </body>
    </html>
  );
}

This matches the Next.js integration guide, which covers both the App Router and Pages Router in more detail.

3. Deploy and verify

  1. Deploy the project (typically to Vercel).
  2. Visit the live 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

// components/track-button.tsx
'use client';
import ours from '@oursprivacy/cdp-sdk';

export function TrackButton() {
  return (
    <button onClick={() => ours.track('ButtonClicked', { button_name: 'sign_up' })}>Sign Up</button>
  );
}

Next Steps

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

How is this guide?

On this page