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 minutesPrerequisites#
- A JustAnalytics account with at least one site
- A Vercel account with a deployed project
Option 1: Vercel Marketplace (Recommended)#
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_IDon your Vercel project - Set
JUSTANALYTICS_API_KEYwith ingest permissions - Set
JUSTANALYTICS_ENDPOINTpointing 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#
- Verify environment variables are set:
vercel env ls - Check that the tracking script is loading (browser DevTools > Network tab)
- Ensure the Site ID matches your JustAnalytics dashboard
Release tracking not working#
- Confirm the webhook is registered in Vercel: Project Settings > Webhooks
- Check the JustAnalytics dashboard under Monitoring > Releases
Removing the integration#
- Go to Vercel dashboard > Integrations > JustAnalytics > Manage
- Click Remove Integration
- This removes the webhook but does not delete environment variables — remove those manually if needed