posthog-instrumentation

द्वारा posthog

PostHog एनालिटिक्स, इवेंट ट्रैकिंग और फीचर फ्लैग को कई फ्रेमवर्क में स्वचालित रूप से इंस्ट्रूमेंट करता है। JavaScript/TypeScript, React, Python और Node.js को फ्रेमवर्क-विशिष्ट सेटअप पैटर्न के साथ सपोर्ट करता है। तीन मुख्य क्षमताओं को कवर करता है: कस्टम प्रॉपर्टी के साथ इवेंट कैप्चर, क्रमिक रोलआउट के लिए फीचर फ्लैग मूल्यांकन और उपयोगकर्ता पहचान। मौजूदा PostHog कॉन्फ़िगरेशन का पता लगाता है और सेट

npx skills add https://github.com/posthog/posthog-for-claude --skill posthog-instrumentation

PostHog Instrumentation Skill

Help users add PostHog analytics, event tracking, and feature flags to their code.

When to Use

  • User asks to "add PostHog" or "add analytics"
  • User wants to track events or user actions
  • User needs to implement feature flags
  • User asks about instrumenting their code

Workflow

  1. Identify the framework (React, Next.js, Python, Node.js, etc.)
  2. Check for existing PostHog setup
  3. Add appropriate instrumentation

Code Patterns

JavaScript/TypeScript

// Event tracking
posthog.capture('button_clicked', { button_name: 'signup' })

// Feature flags
if (posthog.isFeatureEnabled('new-feature')) {
  // Show new feature
}

// User identification
posthog.identify(userId, { email: user.email })

Python

from posthog import Posthog
posthog = Posthog(api_key='<ph_project_api_key>')

# Event tracking
posthog.capture(distinct_id='user_123', event='purchase_completed')

# Feature flags
if posthog.feature_enabled('new-feature', 'user_123'):
    # Show new feature

React

import { usePostHog } from 'posthog-js/react'

function MyComponent() {
  const posthog = usePostHog()

  const handleClick = () => {
    posthog.capture('button_clicked')
  }
}

Best Practices

  • Use consistent event naming (snake_case recommended)
  • Include relevant properties with events
  • Identify users early in their session
  • Use feature flags for gradual rollouts

posthog की और Skills

error-tracking-go
posthog
PostHog द्वारा Go के लिए त्रुटि ट्रैकिंग
official
integration-laravel
posthog
PostHog का Laravel अनुप्रयोगों के लिए एकीकरण
official
integration-nextjs-app-router
posthog
PostHog का Next.js App Router अनुप्रयोगों के लिए एकीकरण
official
logs-other
posthog
PostHog लॉग्स अन्य भाषाओं के लिए
official
logs-python
posthog
PostHog लॉग्स फॉर पायथन
official
analyzing-experiment-session-replays
posthog
प्रयोग वेरिएंट में सत्र रीप्ले पैटर्न का विश्लेषण करें ताकि उपयोगकर्ता व्यवहार में अंतर को समझा जा सके। इसका उपयोग तब करें जब उपयोगकर्ता यह देखना चाहे कि उपयोगकर्ता कैसे इंटरैक्ट करते हैं...
official
auditing-experiments-flags
posthog
PostHog प्रयोगों और फीचर फ्लैग्स का ऑडिट करें, कॉन्फ़िगरेशन समस्याओं, पुरानेपन और सर्वोत्तम-अभ्यास उल्लंघनों के लिए। तब पढ़ें जब उपयोगकर्ता ऑडिट, स्वास्थ्य-जांच, ... के लिए पूछे।
official
auditing-warehouse-data-health
posthog
यह कौशल डेटा वेयरहाउस पाइपलाइन का एक प्रोजेक्ट-व्यापी ऑडिट तैयार करता है। इसका उपयोग तब करें जब उपयोगकर्ता सब कुछ खराब होने का सारांश चाहता है, न कि किसी एक सिंक की गहन जांच। व्यक्तिगत विफलताओं की गहन जांच diagnosing-failed-warehouse-syncs है; यह कौशल वह स्कैन है जो उन्हें बताता है कि पहले कहाँ देखना है।
official