posthog-instrumentation
tarafından posthog
PostHog analitiğini, olay takibini ve özellik bayraklarını birden çok framework üzerinde otomatik olarak enstrümante eder. JavaScript/TypeScript, React, Python ve Node.js'yi framework'e özel kurulum desenleriyle destekler. Üç temel yeteneği kapsar: özel özelliklerle olay yakalama, kademeli dağıtımlar için özellik bayrağı değerlendirme ve kullanıcı tanımlama. Mevcut PostHog yapılandırmasını algılar ve kurulumu tekrarlamadan enstrümantasyon ekler. Olay adlandırma kuralları, özellik... için en iyi uygulamaları içerir.
npx skills add https://github.com/posthog/posthog-for-claude --skill posthog-instrumentationPostHog 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
- Identify the framework (React, Next.js, Python, Node.js, etc.)
- Check for existing PostHog setup
- 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 tarafından daha fazla skill
error-tracking-go
posthog
PostHog Go için hata izleme
official
integration-laravel
posthog
PostHog entegrasyonu, Laravel uygulamaları için
official
integration-nextjs-app-router
posthog
PostHog entegrasyonu, Next.js App Router uygulamaları için
official
logs-other
posthog
Diğer Diller için PostHog Günlükleri
official
logs-python
posthog
PostHog Python günlükleri
official
analyzing-experiment-session-replays
posthog
Deney varyantları arasındaki oturum tekrarı modellerini analiz ederek kullanıcı davranış farklılıklarını anlayın. Kullanıcının, kullanıcıların nasıl etkileşimde bulunduğunu görmek istediği durumlarda kullanın.
official
auditing-experiments-flags
posthog
PostHog deneylerini ve özellik bayraklarını yapılandırma sorunları, güncellik ve en iyi uygulama ihlalleri açısından denetler. Kullanıcı denetim, sağlık kontrolü istediğinde okunur…
official
auditing-warehouse-data-health
posthog
Bu beceri, veri ambarı hattının proje genelinde bir denetimini üretir. Kullanıcı, tek bir senkronizasyonun derinlemesine incelemesini değil, bozuk olan her şeyin bir özetini istediğinde kullanın. Bireysel hataların derinlemesine incelemesi diagnosing-failed-warehouse-syncs becerisidir; bu beceri, onlara ilk olarak nereye bakmaları gerektiğini söyleyen taramadır.
official