configuring-experiment-analytics
Was er macht
Dieser Skill legt fest, wer in die Auswertung eines Experiments einbezogen wird und welche Zahlen zeigen, ob es funktioniert hat. Er richtet sich an Menschen, die die Messseite eines A/B-Tests einrichten.
Wann du ihn nutzt
- ✓Wenn du entscheiden musst, welche Nutzer in einem Experiment gezählt werden sollen.
- ✓Wenn du die primäre und sekundäre Metrik für einen Test wählen willst.
- ✓Wenn du mit Nutzern umgehen musst, die in einem Experiment mehr als eine Variante sehen.
Link zum Skill
https://github.com/PostHog/posthog/blob/master/products/experiments/skills/configuring-experiment-analytics/SKILL.mdKopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.
So nutzt du ihn
Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.
Fertige Nachricht zum Einfügen
Für Claude Code, Codex oder Cursor: Führe den Befehl in deinem Projektordner aus, dann wird der Skill installiert.
Lade die SKILL.md herunter und lege sie in den Skills-Ordner deines Agenten.
Beispielanfrage an deine KI
“Richte mein Checkout-Experiment so ein, dass nur Nutzer zählen, die die Zahlungsseite erreichen, und verfolge die Konversion als Hauptmetrik.”
5 neue Skills pro Woche. 1 Minute Lesezeit.
So funktioniert es
Der Skill legt die Expositionsregel fest, die bestimmt, wer in die Auswertung kommt, und fügt dann die Metriken hinzu, die die Wirkung messen. Er erklärt außerdem, wie mit Nutzern umzugehen ist, die mehrere Varianten sehen.
Technischer Inhalt (originale SKILL.md)
Originaltext des Autors, auf Englisch, direkt von GitHub.
Configuring experiment analytics
This skill answers: Who is included in the analysis? and How to measure impact?
Exposure criteria
Exposure criteria determine which users are counted in the experiment analysis.
Exposure event
Two options:
- Default exposure event — users are included when the experiment's default exposure event fires for the experiment's flag:
$feature_flag_called, or$experiment_exposurefor newer experiments. Which one applies is resolved server-side — readresolved_exposure_eventfromexperiment-getrather than assuming either name (both events carry the same properties). When it is$feature_flag_called, also read$experiment_exposure(event IN ('$feature_flag_called', '$experiment_exposure')), and count persons, not rows. This is the standard approach — it means a user is included only when they actually encounter the feature flag in your code. - Custom exposure event — users are included when a specific custom event fires. Use this when you want tighter control over who enters the analysis (e.g., only users who actually visit the page where the experiment runs).
Filters on the exposure event remove individual events, not users.
A user still counts as long as one of their exposure events passes the filters.
To keep users out of the experiment, exclude them in the flag's release conditions before launch (see configuring-experiment-rollout).
Multiple variant handling
When a user is exposed to multiple variants (e.g., due to flag changes or race conditions):
- Exclude from analysis — removes these users from the analysis entirely. Cleaner data, smaller sample.
- Use first seen variant — assigns users to the first variant they were exposed to. Keeps all users in the analysis. Note that "first seen" can introduce other biases as behavior cannot be clearly attributed to a single variant and is not recommended unless necessary.
Bias risk on uneven splits. "Exclude from analysis" combined with an uneven variant split can introduce bias — multi-variant users are dropped asymmetrically and the smaller variant loses a larger fraction of its assignments. If those users behave differently from the rest, the smaller variant's metrics will be skewed.
The right mitigation depends on experiment state:
- Not yet launched, or only exposed to a few users so far — switch to an even variant split and
use the overall rollout percentage to limit test-variant exposure. This removes the bias and
preserves statistical power. See
configuring-experiment-rollout. - Live experiment with significant exposures — changing the split mid-run reassigns users across variants, which is bad for user experience and data quality. Switch this setting to "Use first seen variant" instead — it keeps already-assigned users in their original variant (no reassignment) and removes the asymmetric exclusion.
Filter test accounts
exposure_criteria.filterTestAccounts (default: true) — excludes internal/test users from the analysis.
Resolving experiments
Metric changes require an experiment ID. If the user refers to an experiment by name
or description (e.g. "add metrics to the checkout test"), load the finding-experiments
skill to resolve it to a concrete ID before proceeding.
Metrics
A metric reaches an experiment one of two ways, both via experiment-update:
- Inline metric — defined directly on the experiment. Sent in the
metricsarray, which replaces the entire inline list, so always get the current experiment first viaexperiment-getto preserve existing metrics. - Shared (saved) metric — a reusable metric object that can be attached to many experiments.
Attached by ID via
saved_metrics_ids(this list also replaces the experiment's existing saved-metric links, so resend the full set — see Step 1).
Prefer reusing a shared metric over duplicating it inline. Build a new inline metric only when no suitable shared metric already exists.
Step 1: Check for an existing shared metric (REQUIRED — match by definition, not name)
Before building any new inline metric, you MUST check whether the project already has a shared (saved) metric that measures the same thing, and reuse it. Duplicating a metric that already exists as a shared metric fragments measurement and is exactly what we want to avoid.
*Reuse is decided by the metric definition — the event or action plus the metric type — not the name.
Häufige Fragen
Was ist ein Expositionsereignis?
Es ist das Ereignis, das zeigt, dass ein Nutzer das Feature-Flag gesehen hat. Dieser Nutzer fließt dann in die Auswertung ein.
Entfernt das Filtern eines Expositionsereignisses einen Nutzer?
Nein. Es entfernt einzelne Ereignisse, und ein Nutzer zählt weiterhin, wenn eines seiner Expositionsereignisse die Filter besteht.
Welche Metriktypen werden unterstützt?
Anzahl-, Summen-, Verhältnis- und Retention-Metriken werden unterstützt.
Details
Originalbeschreibung des Autors
Configures the analytics side of a PostHog experiment — exposure criteria (server-resolved default exposure event 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 from analysis" vs "Use 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 met
repo: PostHog/posthog
Beliebtheit
- GitHub-Sterne
- 41k
- Platz im Ranking
- #6875
- Lizenz
- —
- Aktualisiert
- 2.11.2026
Kommentare
- …
Weitere Skills aus diesem Repository
depot-ci
41kBringt deinem Agenten bei, Depot-CI-Workflows einzurichten, bestehende Workflows zu migrieren und Laufprotokolle auszuwerten.
depot-container-builds
41kHilft deinem Agenten, Docker-Images auf Depot-Remote-Buildern zu bauen, mit Multi-Plattform-Images, Registry-Push und Fehlerbehebung.
depot-github-runners
41kLässt deinen Agenten GitHub-Actions-Jobs auf Depot-Runnern laufen, mit passender Runner-Größe und Labels, und hilft bei Einrichtungsfehlern.
editing-agents-md
41kHilft deinem Agenten zu entscheiden, ob eine Regel in AGENTS.md oder CLAUDE.md gehört, und sie so zu formulieren, dass sie hält.
Ähnliche Skills
gitcrawl
394kLässt deinen Agenten ein gespeichertes Archiv von GitHub-Issues und Pull Requests durchsuchen, Duplikate gruppieren und ihren aktuellen Status auf GitHub prüfen.
slacrawl
394kLässt deinen Agenten Nachrichten in einem lokalen Slack-Archiv durchsuchen und zählen, dessen Aktualität prüfen und es bei Bedarf auffrischen.
goplaces
394kHilft deinem Agenten, mit Google Places nach Orten zu suchen, Details und Bewertungen abzurufen und Ortsnamen aufzulösen, mit JSON-Ausgabe für Skripte.