Skip to content

Improve PostHog usage auto-mapping and one-line install UX#134

Draft
abrichr wants to merge 24 commits intomainfrom
feat/adoption-signals-posthog-metrics
Draft

Improve PostHog usage auto-mapping and one-line install UX#134
abrichr wants to merge 24 commits intomainfrom
feat/adoption-signals-posthog-metrics

Conversation

@abrichr
Copy link
Member

@abrichr abrichr commented Mar 5, 2026

Summary

This PR upgrades homepage adoption signals and install UX with production-safe defaults.

1) Usage metrics from PostHog (server-side)

  • Added exact-first event classification for:
    • demos
    • agent runs
    • GUI actions
  • Added guarded pattern fallback only when exact mappings return no hits.
  • Excluded low-signal/internal events from usage counts:
    • function_trace
    • get_events.started
    • get_events.completed
    • visualize.started
    • visualize.completed
  • Added clearer source metadata in API payload.
  • Fixed availability semantics: if PostHog is reachable/configured, usage source is treated as available even when counts are zero.

2) PostHog config ergonomics

  • POSTHOG_PROJECT_ID now defaults to 68185 in API logic (still overridable by env).
  • Added .env.example for required server-side keys.
  • Added explicit handling for phc_ project token misuse:
    • returns actionable caveat that a personal API key (phx_) is required for reads.

3) Install UX

  • Install section now shows a true one-liner first (per platform), with step-by-step fallback commands below.

Runtime verification

  • npm run build passes.
  • Deploy preview endpoint now returns configured PostHog source with no warnings:
    • /api/project-metrics reports source=posthog_event_definitions
  • Current usage values are 0 because PostHog event-definition 30d volumes for mapped events are currently zero.

Notes

  • (30d) means rolling last 30 days.
  • This PR keeps env override support as fallback for manual counters.

@netlify
Copy link

netlify bot commented Mar 5, 2026

Deploy Preview for cosmic-klepon-3c693c ready!

Name Link
🔨 Latest commit 4397d77
🔍 Latest deploy log https://app.netlify.com/projects/cosmic-klepon-3c693c/deploys/69aba4cdc06827000800d44c
😎 Deploy Preview https://deploy-preview-134--cosmic-klepon-3c693c.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@abrichr abrichr marked this pull request as draft March 5, 2026 20:37
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