Vercel Integration

One-click JustAnalytics setup for Vercel projects with automatic release tracking

Vercel Integration

Deploy JustAnalytics on Vercel with one-click setup. The integration automatically configures environment variables, injects the tracking script, and tracks deployments as releases.

Time to data: 2 minutes

Prerequisites#


Install from Vercel Marketplace

Visit the JustAnalytics integration page on the Vercel Marketplace and click Add Integration.

Select the Vercel scope (personal account or team) and the projects you want to connect.

Connect your JustAnalytics site

After authorizing, you'll be redirected to JustAnalytics to select which site to connect to your Vercel project.

The integration will automatically:

  • Set JUSTANALYTICS_SITE_ID on your Vercel project
  • Set JUSTANALYTICS_API_KEY with ingest permissions
  • Set JUSTANALYTICS_ENDPOINT pointing to the ingestion server
  • Configure deployment webhooks for automatic release tracking

Add the tracking script

For frontend analytics, add the tracking script to your app/layout.tsx (Next.js) or index.html:

// app/layout.tsx (Next.js App Router)
import Script from 'next/script';

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html>
      <head>
        <Script
          defer
          data-site-id={process.env.NEXT_PUBLIC_JUSTANALYTICS_SITE_ID}
          src="https://justanalytics.app/tracker.js"
          strategy="afterInteractive"
        />
      </head>
      <body>{children}</body>
    </html>
  );
}

Add server-side SDK (optional)

For APM, error tracking, and structured logging, install the Node.js SDK:

npm install @justanalyticsapp/node

Initialize in instrumentation.ts:

// instrumentation.ts
export async function register() {
  if (process.env.NEXT_RUNTIME === 'nodejs') {
    const { JustAnalytics } = await import('@justanalyticsapp/node');
    JustAnalytics.init(); // Reads from JUSTANALYTICS_* env vars
  }
}

Option 2: Manual Setup#

If you prefer not to use the Marketplace integration, you can configure everything manually.

1. Set Environment Variables#

In your Vercel project dashboard, go to Settings > Environment Variables and add:

| Variable | Value | Description | |----------|-------|-------------| | JUSTANALYTICS_SITE_ID | Your site ID | From JustAnalytics dashboard | | JUSTANALYTICS_API_KEY | ja_sk_... | From Settings > API Keys | | JUSTANALYTICS_ENDPOINT | https://justanalytics.app | Ingestion endpoint |

2. Deploy#

Push a new commit or trigger a redeploy. The environment variables will be available at build time and runtime.


Automatic Release Tracking#

When the Vercel integration is connected, every successful deployment is automatically registered as a release in JustAnalytics. This enables:

  • Release timeline on the dashboard
  • Regression detection — error rate and performance comparisons between releases
  • Deployment history with commit SHAs and authors

Release data includes:

  • Commit SHA and message (from GitHub/GitLab metadata)
  • Deployment environment (production vs preview)
  • Deploy timestamp and author

Troubleshooting#

Integration not receiving data#

  1. Verify environment variables are set: vercel env ls
  2. Check that the tracking script is loading (browser DevTools > Network tab)
  3. Ensure the Site ID matches your JustAnalytics dashboard

Release tracking not working#

  1. Confirm the webhook is registered in Vercel: Project Settings > Webhooks
  2. Check the JustAnalytics dashboard under Monitoring > Releases

Removing the integration#

  1. Go to Vercel dashboard > Integrations > JustAnalytics > Manage
  2. Click Remove Integration
  3. This removes the webhook but does not delete environment variables — remove those manually if needed