LVBT Analytics gives Las Vegans for Better Transit one privacy-preserving measurement standard across its public websites and tools. Cloudflare Web Analytics records page use and performance; the first-party collector records a small, typed set of conversion events.
The system does not set cookies, create visitor identifiers, fingerprint browsers, or retain IP addresses and user agents. Global Privacy Control and Do Not Track disable both measurement paths. Analytics stays off on localhost, preview deployments, retired archives, and framed embeds.
| Project | Entry point | Setup |
|---|---|---|
| Astro | @lasvegasfortransit/analytics/astro |
Add lvbtAnalytics({ site }) to astro.config.ts |
| Vite or React | @lasvegasfortransit/analytics |
Call init({ site, token }) before rendering |
| React component tree | @lasvegasfortransit/analytics/react |
Render <Analytics> and call useTrack() |
| Plain HTML | generated client | Run lvbt-analytics client --out public/lvbt-analytics.js |
Production builds receive PUBLIC_LVBT_CWA_TOKEN and set LVBT_REQUIRE_ANALYTICS=1. Preview and
local builds receive neither value, so the client is absent rather than merely pointed at a test
property.
import lvbtAnalytics from '@lasvegasfortransit/analytics/astro';
export default defineConfig({
integrations: [lvbtAnalytics({ site: 'labs.lasvegasfortransit.org' })],
});import { init } from '@lasvegasfortransit/analytics';
init({
site: 'map.lasvegasfortransit.org',
token: import.meta.env.PUBLIC_LVBT_CWA_TOKEN,
noPageviews: [/^\/s\//],
});Start with the integration tutorial. The privacy contract defines the non-negotiable data boundary, and the operations runbook covers a quiet dashboard or failed collector.
pnpm bootstrap
pnpm checkThe workspace contains the published client in packages/analytics, the collector Worker in
apps/collector, and the fixed-query report command in tools/report. The
documentation index groups contributor material by task.