Loading...
Loading...
Configures the analytics side of a PostHog experiment — exposure criteria (default `$feature_flag_called` vs custom exposure events), primary and secondary metrics, the supported metric types (count, sum, ratio with `math` and `math_property`, retention with `retention_window_start` and `start_handling`), multivariate user handling ("Exclude" vs "First seen variant"), and how to read results once the experiment is live. Use when the user adds or edits a primary or secondary metric (e.g. "add a secondary metric tracking 'downloaded_file' per user"), sets up a ratio metric (e.g. "revenue from purchase_completed / pageviews"), sets up a retention metric (e.g. "$pageview → uploaded_file, 7-day window"), configures custom exposure (e.g. "only count users who hit /checkout"), changes multivariate handling, or asks "who is in the analysis?", "how do I measure impact?", "is this winning?", "what's the confidence level?", or "should I ship?".
npx skill4agent add posthog/ai-plugin configuring-experiment-analytics$feature_flag_calledconfiguring-experiment-rolloutexposure_criteria.filterTestAccountsfinding-experimentsexperiment-updatemetricsexperiment-getread-data-schemaread-data-schemaallow_unknown_events: trueexperiment-createexperiment-updateUser: "Let's add some metrics for the checkout experiment"
WRONG: "I'd suggest using purchase_completed as the primary metric..."
(hallucinated event name — never seen the project's actual events)
RIGHT: *calls read-data-schema* → "Here are the events in your project
related to checkout: `checkout_step_completed`, `payment_processed`,
`order_confirmed`. Which of these represents a successful checkout?"kind: "ExperimentMetric"| metric_type | When to use | Key fields |
|---|---|---|
| Average of a numeric property per user (revenue, session duration, pageviews per user) | |
| Conversion rate from exposure through one or more ordered actions | |
| Rate of one event relative to another | |
| Do users come back after exposure? | |
step_0series$pageviewcheckout_completedreferences/metric-configuration.mdreferences/interpreting-results.md