- Home
- Skills
- Alinaqi
- Claude Bootstrap
- Posthog Analytics
posthog-analytics_skill
- Shell
450
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill alinaqi/claude-bootstrap --skill posthog-analytics- SKILL.md20.4 KB
Overview
This skill implements PostHog analytics for web and backend projects, covering event tracking, user identification, feature flags, and dashboards. It provides opinionated, security-first defaults and concrete patterns for Next.js, React, Node, and Python integrations. The goal is to measure meaningful outcomes and make analytics actionable for product decisions.
How this skill works
The skill initializes PostHog clients for frontend frameworks (Next.js App Router, Vite/CRA) and backend runtimes (Node, Python) with safe defaults such as identified-only profiles and controlled pageview capture. It supplies helpers for identify, capture, and shutdown, a lightweight React hook for event tracking, and examples for server-side flag evaluation. It also defines naming conventions, core event categories, and recommended dashboard templates.
When to use it
- Add product analytics to measure activation, retention, and feature adoption.
- Implement feature flags and experiments for progressive rollout and A/B testing.
- Track backend events (billing, errors, conversions) server-side.
- Create project-specific dashboards to answer acquisition, activation, and revenue questions.
- Keep analytics secure and compliant by separating public client keys from backend API keys.
Best practices
- Measure what matters: define a small set of core events and user properties first.
- Use snake_case and past-tense event names (e.g., user_signed_up, onboarding_completed).
- Identify users on signup/login and call posthog.reset() on logout to avoid leaking identities.
- Capture timestamps and minimal context; avoid indiscriminate PII collection.
- Use server-side flag evaluation for authenticated pages and client-side hooks for UI toggles.
Example use cases
- Track onboarding funnels: onboarding_started → onboarding_step_completed → onboarding_completed to find drop-offs.
- Feature rollout: expose a new UI via a feature flag and capture experiment_viewed with variant metadata.
- Billing analytics: capture checkout_started and subscription_upgraded with MRR changes for revenue dashboards.
- Error monitoring: capture error_occurred events with error_type and page to prioritize fixes.
- AI product metrics: track queries per user, token usage, and success signals to optimize prompts and pricing.
FAQ
Public keys (NEXT_PUBLIC_ or VITE_) go to the browser; keep POSTHOG_API_KEY and host secrets on the server only.
When should I identify a user?
Identify on signup or first authenticated action, update properties on profile changes, and reset on logout.