This documents the Statsig integration in Tiger-Data-Docs: what it does, where the code lives, how to use it with metrics, and how to fully remove it when it's time.
A client-side Statsig SDK loads on every page and:
- Identifies the user via Segment's
ajs_anonymous_idcookie - Initializes
StatsigClientwith session replay + web analytics - Checks the
new_docs_site_rolloutgate (logs an exposure for metrics)
The gate exposure lets you measure metric lifts (DAU, WAU, stickiness, and so on) for users who land on the new docs site.
| What | Where |
|---|---|
| Inline script | astro.config.ts (search for BEGIN STATSIG) |
| Env var | PUBLIC_STATSIG_CLIENT_KEY in .env.local and Vercel env settings |
| Env var docs | .env.example lines 10-12 |
| Statsig gate | new_docs_site_rollout (Statsig console → Feature Gates) |
The gate has measureMetricLifts: true enabled, with these monitoring metrics already configured:
dau,wau,mau_28d(daily/weekly/monthly active users)new_dau(new daily active users)l7(L7 retention)weekly_stickiness,monthly_stickiness
- Go to Statsig console > Metrics
- Create or select a metric (for example, page views, search usage)
- Open the
new_docs_site_rolloutgate in Statsig console >Monitoring Metricstab - Add your metric. It will start tracking lifts for gate-exposed users
Open the gate in Statsig console > Results tab to see metric lifts between exposed and unexposed populations.
When you're ready to archive the Statsig integration:
- Open the
new_docs_site_rolloutgate in Statsig console - Click
Archive(or disable it first, wait a cycle, then archive) - Export any metric results you want to keep before archiving
Delete everything between the BEGIN STATSIG and END STATSIG markers (inclusive):
// In astro.config.ts, inside the head[] array, delete this entire block:
// ──── BEGIN STATSIG ────
// ...everything in between...
// ──── END STATSIG ────- Vercel: Project Settings > Environment Variables > delete
PUBLIC_STATSIG_CLIENT_KEY - Local: Remove the
PUBLIC_STATSIG_CLIENT_KEYline from.env.local
Remove the Statsig section (lines 10-12):
# Statsig Client SDK key (safe for browser, used for exposure logging in gradual rollout).
# Get from: Statsig Console → Project Settings → Keys & Environments → Client API Key
# PUBLIC_STATSIG_CLIENT_KEY=client-xxxxx
rm README-statsig.md
- Run
pnpm build: confirm no references toPUBLIC_STATSIG_CLIENT_KEY - Deploy to preview: confirm no Statsig network requests in browser devtools
- Check the Statsig console: confirm the gate shows as archived
- 2026-03: Integration added for gradual rollout of new docs site (Tiger-Data-Docs) replacing legacy Gatsby docs (web-documentation)
- 2026-04: Domain migration to tigerdata.com/docs completed. Orphaned sticky cookie (
td_new_docs) removed. Integration kept for session replay, web analytics, and metric tracking.