Analytics implementation skill. Activates when users need to design and implement product analytics, event tracking, funnel analysis, A/B test instrumentation, or privacy-respecting analytics. Supports Segment, Amplitude, Mixpanel, PostHog, Plausible, and Umami. Provides structured event taxonomies, data modeling, funnel design, and experiment instrumentation with full privacy compliance. Triggers on: /godmode:analytics, "add analytics", "track events", "set up A/B testing", "implement funnels", or when the orchestrator detects analytics-related work.
From godmodenpx claudepluginhub arbazkhan971/godmodeThis skill uses the workspace's default tool permissions.
Designs and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Enables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
/godmode:analytics/godmode:plan identifies analytics instrumentation tasksUnderstand what needs to be measured and why:
ANALYTICS DISCOVERY:
Project: <name and purpose>
Goals:
- <business goal 1 — e.g., increase conversion rate>
- <business goal 2 — e.g., reduce churn>
- <business goal 3 — e.g., improve feature adoption>
Key questions to answer:
- <question 1 — e.g., "Where do users drop off in onboarding?">
- <question 2 — e.g., "Which features correlate with retention?">
- <question 3 — e.g., "What is our activation rate?">
Platform: <web | mobile | both | server-side>
Framework: <React | Next.js | Vue | React Native | iOS | Android | backend>
Privacy requirements: <GDPR | CCPA | HIPAA | none | strict — no third-party>
Existing analytics: <none | GA4 | Segment | Amplitude | Mixpanel | custom>
Budget: <free tier | startup plan | enterprise>
If the user hasn't specified, ask: "What do you want to learn about your users? What decisions will this data inform?"
Choose the right analytics stack:
PLATFORM SELECTION:
| Platform | Best For | Privacy Model |
|--|--|--|
| Segment | Data routing hub, | Third-party, consent needed |
| | multi-destination CDP | GDPR tools available |
| Amplitude | Product analytics, | Third-party, consent needed |
| | behavioral cohorts, | SOC 2, GDPR compliant |
| | journey mapping | |
| Mixpanel | Event analytics, | Third-party, consent needed |
| | funnel analysis, | EU data residency available |
| | retention tracking | |
Design a structured, consistent event naming system:
EVENT TAXONOMY:
Naming convention: <Object Action> (e.g., "Button Clicked", "Page Viewed")
Format: <object>_<action> (snake_case) or <Object> <Action> (Title Case)
Selected: <format>
EVENT CATALOG:
| Event Name | Trigger | Properties |
LIFECYCLE EVENTS
| User Signed Up | Server | method, referral_source, |
| | | plan |
| User Logged In | Server | method, mfa_used |
Define property types and validation:
PROPERTY STANDARDS:
GLOBAL PROPERTIES (sent with every event):
user_id: string (anonymous ID or authenticated user ID)
session_id: string (unique per session)
timestamp: ISO 8601 datetime
platform: "web" | "ios" | "android"
app_version: string (semver)
device_type: "desktop" | "tablet" | "mobile"
browser: string (web only)
os: string
locale: string (BCP 47 — e.g., "en-US")
experiment_ids: string[] (active A/B test assignments)
USER PROPERTIES (set once, updated on change):
Implement analytics tracking in the codebase:
Configure the selected provider SDK (Segment, Amplitude, PostHog, etc.) with environment-keyed initialization.
Build a unified abstraction layer (AnalyticsProvider interface with track, identify, page methods) so
you swap providers without touching component code.
Design and instrument conversion funnels:
FUNNEL DESIGN:
Funnel name: <name — e.g., "Onboarding Funnel">
Goal: <what conversion means — e.g., "User completes onboarding">
FUNNEL STEPS:
| Step | Name | Event | Expected % |
|--|--|--|--|
| 1 | Visit landing page | Page Viewed | 100% |
| 2 | Click sign up | CTA Clicked | 30-40% |
| 3 | Complete registration | User Signed Up | 60-70% |
| 4 | Start onboarding flow | Onboarding Started | 80-90% |
| 5 | Complete onboarding | Onboarding Done | 50-60% |
| 6 | First core action | Feature Used | 40-50% |
| 7 | Activation (aha moment) | Activation Done | 30-40% |
Design and instrument experiments:
EXPERIMENT DESIGN:
Name: <experiment name>
Hypothesis: <if we change X, then Y will improve by Z%>
Primary metric: <metric to optimize — e.g., conversion rate>
Secondary metrics: <guardrail metrics to monitor — e.g., session duration, error rate>
Minimum detectable effect: <smallest meaningful change — e.g., 5% relative improvement>
Required sample size: <calculated based on MDE, baseline, significance level>
Duration: <estimated experiment duration>
Significance level: alpha = 0.05
Power: 1 - beta = 0.80
VARIANTS:
| Variant | Description | Traffic % |
// experiments/ab-test.ts
interface Experiment {
id: string;
name: string;
variants: { id: string; weight: number }[];
isActive: boolean;
DATA MODEL (3 core tables):
EVENTS: event_id (PK), event_name (indexed), user_id (indexed), session_id,
timestamp (partitioned by day), properties (JSONB), context (JSONB)
USERS: user_id (PK), traits (JSONB), first_seen, last_seen, event_count
SESSIONS: session_id (PK), user_id (indexed), started_at, ended_at,
duration_sec, entry_page, exit_page, device_type, utm_*
COMMON QUERIES:
- DAU/WAU/MAU: COUNT(DISTINCT user_id) WHERE timestamp >= <period>
- Retention: cohort analysis grouping by first_seen week
- Funnel: sequential event matching with time constraints
- Feature adoption: COUNT(DISTINCT user_id) WHERE event_name = '<feature>'
Implement privacy-compliant analytics:
PRIVACY IMPLEMENTATION:
| Requirement | Implementation |
|--|--|
| Consent management | Cookie banner with granular |
| | opt-in/opt-out per category |
| No tracking before consent | Analytics SDK loads only after |
| | user grants consent |
| Data minimization | Track only necessary events, |
| | no PII in properties |
| User data deletion | API endpoint to delete all data |
| | for a user_id (GDPR Art. 17) |
Validate the analytics implementation:
ANALYTICS VALIDATION:
| Check | Status |
|--|--|
| All events in taxonomy are instrumented | PASS | FAIL |
| Event names follow naming convention | PASS | FAIL |
| Properties match documented schema | PASS | FAIL |
| No PII in any event properties | PASS | FAIL |
| Consent gate works (no tracking before consent) | PASS | FAIL |
| Funnels capture all steps correctly | PASS | FAIL |
| A/B test assignment is deterministic and sticky | PASS | FAIL |
| Data appears in analytics dashboard | PASS | FAIL |
| DNT/opt-out disables all tracking | PASS | FAIL |
| User deletion API works (GDPR compliance) | PASS | FAIL |
| Events fire on correct triggers (not duplicated) | PASS | FAIL |
ANALYTICS IMPLEMENTATION COMPLETE:
Artifacts:
- Analytics config: src/analytics/config.ts
- Event taxonomy: docs/analytics/event-taxonomy.md
- Tracking module: src/analytics/index.ts
- Provider implementations: src/analytics/providers/<provider>.ts
- Consent manager: src/consent/manager.ts
- Funnel definitions: docs/analytics/funnels.md
- A/B test configs: src/experiments/<experiment>.ts
- Data model: docs/analytics/data-model.md
Platform: <platform(s)>
Events tracked: <N> events across <M> categories
Funnels: <N> funnels defined
Commit: "analytics: <platform> — <N> events, <M> funnels, <privacy model>"
Never ask to continue. Loop autonomously until all events are instrumented and validated.
# Validate analytics implementation
npm run test:analytics
npx ts-node scripts/analytics-audit.ts --check-pii --check-taxonomy
IF event count > 100: audit for redundancy, merge similar events. WHEN PII detected in event properties: remove immediately, purge from provider. IF consent gate bypassed: block deployment, treat as P0 bug.
| Flag | Description |
|---|---|
| (none) | Full analytics design and implementation workflow |
--platform <name> | Force platform: segment, amplitude, mixpanel, posthog, plausible, umami, ga4 |
--taxonomy | Design event taxonomy only (no implementation) |
AUTO-DETECT:
1. SDKs: grep for '@segment/analytics', 'amplitude', 'mixpanel', 'posthog', 'plausible', 'umami', gtag.js
2. Framework: React/Next.js (app vs pages router), Vue/Nuxt, Mobile SDKs
3. Existing events: grep for '.track(', '.capture(', 'analytics.track', 'gtag('
4. Consent: grep for 'cookie-consent', 'cookiebot', 'onetrust'
5. Data warehouse: BigQuery, Snowflake, Redshift configs
6. Privacy: GDPR/CCPA references, EU deployment regions
7. Auto-configure: recommend platform or audit existing for gaps
ANALYTICS IMPLEMENTATION REPORT:
Platform: <Segment | Amplitude | PostHog | etc>
Events tracked: <N> across <M> categories
Funnels defined: <N>
Experiments: <N> A/B tests instrumented
Privacy model: <GDPR compliant | cookieless | consent-based>
PII audit: CLEAN | <N> violations found
Verdict: PASS | NEEDS REVISION
timestamp skill action platform events funnels privacy_model status
Complete when ALL true:
| Failure | Action |
|---|---|
| Events not appearing | Check console errors, verify API key, use analytics debugger, check ad blockers/CSP. |
KEEP if: improvement verified. DISCARD if: regression or no change. Revert discards immediately.
Stop when: target reached, budget exhausted, or >5 consecutive discards.