instrument-product-analytics

Add PostHog event captures for client-side and server-side user actions.

58|5|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/PostHog/skills --skill instrument-product-analytics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: instrument-product-analytics
Source: https://github.com/PostHog/skills/tree/main/skills/omnibus/instrument-product-analytics
Command: npx skills add https://github.com/PostHog/skills --skill instrument-product-analytics

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Add PostHog product analytics events to track meaningful user actions in codebases after implementing new features or reviewing PRs, ensuring you capture valuable signals.

Core Features & Use Cases

  • Instrument client-side and server-side analytics calls using PostHog across frameworks.
  • Provide a pattern for identifying users and capturing events such as feature usage, errors, and funnels.
  • Demonstrate step-by-step integration guided by framework references and example projects.

Quick Start

Run the instrument-product-analytics skill in a codebase to automatically add analytics instrumentation and initialize PostHog if needed.

Frequently Asked Questions about instrument-product-analytics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I instrument PostHog product analytics events across my codebase?

To instrument PostHog product analytics, you identify meaningful user actions and add event capture calls aligned with framework references, covering both client-side and server-side events with proper user identification.

What is the best way to avoid duplicate analytics events during client-side and server-side instrumentation?

Avoiding duplicate analytics events requires careful event capture planning during instrumentation, ensuring proper user identification and error handling while distinguishing between client-side and server-side tracking scopes.

Can I use PostHog to capture both client-side and server-side user actions?

Yes, you can capture both client-side and server-side user actions using PostHog, ensuring proper user identification and error reporting by following official framework references to implement event captures.

How do I initialize PostHog and identify users when adding tracking to a new feature?

Initializing PostHog and identifying users involves adding event capture and identify calls guided by framework references, ensuring you track feature usage, funnels, and errors while handling user identification properly.

Does instrumenting server-side analytics require different handling than client-side events?

Instrumenting server-side analytics differs from client-side events by requiring distinct capture implementation paths, while both must ensure proper user identification and error handling to avoid duplicate events across the stack.