PostHog secrets provisioning (Stage 2 revenue digest)
The revenue digest workflow (.github/workflows/revenue-digest.yml, shipped in PR #727) needs three new secrets in GCP Secret Manager so the funnel-conversion line resolves. Until they exist the workflow runs but the PostHog provider is skipped with skip_reason: missing POSTHOG_API_KEY/PROJECT_ID/FUNNEL_ID.
Prerequisites
- PostHog account access (org-level; current owner of
latwoodtech.posthog.comor whichever cloud project is canonical) gcloudauthenticated againstfactory-495015withroles/secretmanager.admin- The funnel definition itself must exist in PostHog first (issue #657 G34 is in flight — supervisor is creating canonical funnels for HumanDesign + xico-city)
Step 1 — Create a PostHog personal API key
- PostHog UI → Settings → Personal API Keys → “Create personal API key”
- Scope:
insight:read+funnel:read(minimum needed byrevenue_digest.collect_posthog_funnel) - Copy the
phx_…value
Step 2 — Get the project ID
PostHog UI → Settings → Project Details → “Project ID” (numeric, e.g.12345)
Step 3 — Get the funnel ID
After #657 lands its canonical funnels:- Open the primary monetization funnel
- Copy the numeric ID from the URL (
…/insights/{ID}or…/funnels/{ID})
Step 4 — Write the three secrets
Run from a shell authenticated tofactory-495015. Use here-strings (no trailing newline / BOM — Stage 1 lesson, see scripts/fetch_gcp_secrets.sh).
Step 5 — Verify
Trigger the workflow manually:posthog_funnel provider line in the resulting docs/revenue/<DATE>.json. If skipped: true with skip_reason: missing POSTHOG_*, the GCP fetch didn’t pick the secret up — verify naming against fetch_to_env candidates in .github/workflows/revenue-digest.yml.
Rotation
PostHog personal API keys don’t expire. Rotate annually or on personnel change:Related
- PR #727 — revenue digest implementation (
scripts/revenue_digest.py) - Issue #657 — PostHog funnel definitions (G34, in flight)
scripts/fetch_gcp_secrets.sh— first-match-wins helper used by the workflow