Skip to content
Backpack
Esc
navigateopen⌘Jpreview

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.

  1. Auth: POST /api/auth/login with UMAMI_USERNAME/UMAMI_PASSWORD (env vars only, never printed).
  2. Idempotency: GET /api/websites?query=<domain>, match the exact domain.
  3. Register if missing: POST /api/websites {name, domain}. Webflow-staging sources use <project>.vercel.app; custom-domain sources use the target apex.
  4. 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.
  5. Verify: live page serves the correct data-website-id, and the site row on the console /analytics page resolves.
  6. 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.

Was this page helpful?