Playbook: analytics tracking
The standing workflow for every finished or ported site.
Every finished or ported site gets registered in Umami and carries the script before it is called done.
- Auth: POST /api/auth/login with UMAMI_USERNAME/UMAMI_PASSWORD (env vars only, never printed).
- Idempotency: GET /api/websites?query=
<domain>, match the exact domain. - Register if missing: POST /api/websites
{name, domain}. Webflow-staging sources use<project>.vercel.app; custom-domain sources use the target apex. - Inject: static sites get the script tag before
</head>on every page (skip pages already containing data-website-id). Next.js sites use env-gated next/script via NEXT_PUBLIC_UMAMI_WEBSITE_ID and NEXT_PUBLIC_UMAMI_SRC project envs. - Verify: live page serves the correct data-website-id, and the site row on the console /analytics page resolves.
- Report the dashboard link: analytics.backpackops.com/websites/
<id>.
porter/umami.py automates steps 1 through 4 for static sites and prints website_id and dashboard lines.