Skip to content

feat(site): add PostHog analytics to landing and docs pages - #55

Merged
itaywol merged 1 commit into
mainfrom
feat/posthog
Jul 25, 2026
Merged

itaywol merged 1 commit into
mainfrom
feat/posthog

Conversation

@itaywol

@itaywol itaywol commented Jul 25, 2026 •

Copy link
Copy Markdown
Owner

Adds PostHog analytics, bundled from npm (posthog-js) instead of the external CDN snippet.

  • Key injected at build via PUBLIC_POSTHOG_KEY: site/.env (gitignored) locally, repo variable in CI. The key never appears in git (branch history rewritten; earlier snippet commit dropped).
  • Starlight Head override ships the bundled script on every docs page; landing imports the same module. No key set = analytics silently off.
  • Adds .github/workflows/site.yml: build + wrangler deploy on pushes to main touching site/. Needs the CLOUDFLARE_API_TOKEN repo secret before it can deploy (manual wrangler deploy keeps working meanwhile).
  • Verified live: analytics bundle loads on / and /docs/, events flow to US cloud.

- posthog-js bundled from npm (no external snippet load); init key read
  from PUBLIC_POSTHOG_KEY at build time so it never appears in git.
  Local builds read site/.env (gitignored); CI reads a repo variable.
- Starlight Head override ships the same bundled script on every docs
  page; the landing page imports it directly.
- New site deploy workflow: builds and wrangler-deploys on pushes to
  main touching site/ (needs the CLOUDFLARE_API_TOKEN repo secret).
@itaywol
itaywol merged commit 62a3364 into main Jul 25, 2026
11 checks passed
@itaywol
itaywol deleted the feat/posthog branch July 25, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant