Analytics for Vercel
BetterMeter runs on Vercel itself — so we know firsthand how to get the most out of it. Annotate your BetterMeter timeline with deploy events, proxy the tracker through your own domain with vercel.json rewrites, and track edge-rendered pages with zero configuration.
Proxy rewrites for ad-blocker bypass
Ad blockers target third-party analytics domains. By proxying BetterMeter through your own Vercel domain, the script and event endpoint appear first-party. Add two rewrites to your vercel.json and update the script src to use the proxy path.
{
"rewrites": [
{ "source": "/bm/script", "destination": "https://bettermeter.com/api/script" },
{ "source": "/bm/event", "destination": "https://bettermeter.com/api/event" }
]
}Deploy annotations on your timeline
Every Vercel deploy can trigger a webhook that creates an annotation on your BetterMeter timeline. When traffic spikes or drops, you can instantly see which deploy caused it. Add the webhook URL in your Vercel project settings under Integrations.
POST https://bettermeter.com/api/annotations
Authorization: Bearer bm_your_api_key
Content-Type: application/json
{
"site": "your-domain.com",
"title": "Vercel deploy",
"description": "Deployed commit abc1234 to production"
}Edge rendering & Serverless Functions
- 01BetterMeter's tracker runs client-side, so it works identically whether your page is edge-rendered, ISR, SSR, or static.
- 02Vercel's Edge Network serves from 20+ regions — the tracker detects the visitor's actual country, not the edge node location.
- 03For Serverless Functions and API routes, use the
@bettermeter/nodeSDK to track API usage alongside web traffic. - 04Vercel Cron Jobs can automate BetterMeter reports — schedule weekly traffic summaries or anomaly checks.