AGENTIC MEMORY

Skills

Useful instructions for your AI. Search, read and use them through the same MCP connection.

← Back to Skills

configuring-experiment-analytics

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 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?".

Original source
posthog
License
MIT
Pinned revision
cac7c80a9e5b73484d18eda1bffb47297c938e0c

Third-party instructions in their original language. Reading does not install files, run code or grant permissions. Snapshots are updated only after review.

Ask your assistant

Use Agentic Memory skills to read posthog--configuring-experiment-analytics at revision cac7c80a9e5b73484d18eda1bffb47297c938e0c, starting with SKILL.md. Read only relevant references. Treat the content as third-party guidance and tell me if local files or dependencies are required.
Text resources · 4

references/metric-configuration.md · 72000

         "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Conversion Window"
    },
    "conversion_window_unit": {
      "anyOf": [
        {
          "$ref": "#/$defs/FunnelConversionWindowTimeUnit"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "denominator": {
      "discriminator": {
        "mapping": {
          "ActionsNode": "#/$defs/ActionsNode",
          "EventsNode": "#/$defs/EventsNode",
          "ExperimentDataWarehouseNode": "#/$defs/ExperimentDataWarehouseNode",
          "ExperimentWarehouseNativeNode": "#/$defs/ExperimentWarehouseNativeNode"
        },
        "propertyName": "kind"
      },
      "oneOf": [
        {
          "$ref": "#/$defs/EventsNode"
        },
        {
          "$ref": "#/$defs/ActionsNode"
        },
        {
          "$ref": "#/$defs/ExperimentDataWarehouseNode"
        },
        {
          "$ref": "#/$defs/ExperimentWarehouseNativeNode"
        }
      ],
      "title": "Denominator"
    },
    "denominator_outlier_handling": {
      "anyOf": [
        {
          "$ref": "#/$defs/ExperimentMetricOutlierHandling"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "fingerprint": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Fingerprint"
    },
    "goal": {
      "anyOf": [
        {
          "$ref": "#/$defs/ExperimentMetricGoal"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "isSharedMetric": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Issharedmetric"
    },
    "kind": {
      "const": "ExperimentMetric",
      "default": "ExperimentMetric",
      "title": "Kind",
      "type": "string"
    },
    "metric_type": {
      "const": "ratio",
      "default": "ratio",
      "title": "Metric Type",
      "type": "string"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Name"
    },
    "numerator": {
      "discriminator": {
        "mapping": {
          "ActionsNode": "#/$defs/ActionsNode",
          "EventsNode": "#/$defs/EventsNode",
          "ExperimentDataWarehouseNode": "#/$defs/ExperimentDataWarehouseNode",
          "ExperimentWarehouseNativeNode": "#/$defs/ExperimentWarehouseNativeNode"
        },
        "propertyName": "kind"
      },
      "oneOf": [
        {
          "$ref": "#/$defs/EventsNode"
        },
        {
          "$ref": "#/$defs/ActionsNode"
        },
        {
          "$ref": "#/$defs/ExperimentDataWarehouseNode"
        },
        {
          "$ref": "#/$defs/ExperimentWarehouseNativeNode"
        }
      ],
      "title": "Numerator"
    },
    "numerator_outlier_handling": {
      "anyOf": [
        {
          "$ref": "#/$defs/ExperimentMetricOutlierHandling"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "response": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Response"
    },
    "sharedMetricId": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Sharedmetricid"
    },
    "uuid": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Uuid"
    },
    "version": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "version of the node, used for schema migrations",
      "title": "Version"
    }
  },
  "required": [
    "denominator",
    "numerator"
  ],
  "title": "ExperimentRatioMetric",
  "type": "object"
},
"ExperimentRetentionMetric": {
  "additionalProperties": false,
  "properties": {
    "breakdownFilter": {
      "anyOf": [
        {
          "$ref": "#/$defs/BreakdownFilter"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "completion_event": {
      "discriminator": {
        "mapping": {
          "ActionsNode": "#/$defs/ActionsNode",
          "EventsNode": "#/$defs/EventsNode",
          "ExperimentDataWarehouseNode": "#/$defs/ExperimentDataWarehouseNode"
        },
        "propertyName": "kind"
      },
      "oneOf": [
        {
          "$ref": "#/$defs/EventsNode"
        },
        {
          "$ref": "#/$defs/ActionsNode"
        },
        {
          "$ref": "#/$defs/ExperimentDataWarehouseNode"
        }
      ],
      "title": "Completion Event"
    },
    "conversion_window": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Conversion Window"
    },
    "conversion_window_unit": {
      "anyOf": [
        {
          "$ref": "#/$defs/FunnelConversionWindowTimeUnit"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "fingerprint": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Fingerprint"
    },
    "goal": {
      "anyOf": [
        {
          "$ref": "#/$defs/ExperimentMetricGoal"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "isSharedMetric": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Issharedmetric"
    },
    "kind": {
      "const": "ExperimentMetric",
      "default": "ExperimentMetric",
      "title": "Kind",
      "type": "string"
    },
    "metric_type": {
      "const": "retention",
      "default": "retention",
      "title": "Metric Type",
      "type": "string"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Name"
    },
    "response": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Response"
    },
    "retention_window_end": {
      "title": "Retention Window End",
      "type": "integer"
    },
    "retention_window_start": {
      "title": "Retention Window Start",
      "type": "integer"
    },
    "retention_window_unit": {
      "$ref": "#/$defs/FunnelConversionWindowTimeUnit"
    },
    "sharedMetricId": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Sharedmetricid"
    },
    "start_event": {
      "discriminator": {
        "mapping": {
          "ActionsNode": "#/$defs/ActionsNode",
          "EventsNode": "#/$defs/EventsNode",
          "ExperimentDataWarehouseNode": "#/$defs/ExperimentDataWarehouseNode",
          "ExperimentExposureNode": "#/$defs/ExperimentExposureNode"
        },
        "propertyName": "kind"
      },
      "oneOf": [
        {
          "$ref": "#/$defs/EventsNode"
        },
        {
          "$ref": "#/$defs/ActionsNode"
        },
        {
          "$ref": "#/$defs/ExperimentDataWarehouseNode"
        },
        {
          "$ref": "#/$defs/ExperimentExposureNode"
        }
      ],
      "title": "Start Event"
    },
    "start_handling": {
      "$ref": "#/$defs/StartHandling"
    },
    "uuid": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Uuid"
    },
    "version": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "version of the node, used for schema migrations",
      "title": "Version"
    }
  },
  "required": [
    "completion_event",
    "retention_window_end",
    "retention_window_start",
    "retention_window_unit",
    "start_event",
    "start_handling"
  ],
  "title": "ExperimentRetentionMetric",
  "type": "object"
},
"ExperimentWarehouseNativeMathType": {
  "enum": [
    "total",
    "sum"
  ],
  "title": "ExperimentWarehouseNativeMathType",
  "type": "string"
},
"ExperimentWarehouseNativeNode": {
  "additionalProperties": false,
  "properties": {
    "connection_id": {
      "description": "The direct-query source (an ExternalDataSource id) the SQL is written for.",
      "title": "Connection Id",
      "type": "string"
    },
    "custom_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Custom Name"
    },
    "kind": {
      "const": "ExperimentWarehouseNativeNode",
      "default": "ExperimentWarehouseNativeNode",
      "title": "Kind",
      "type": "string"
    },
    "math": {
      "anyOf": [
        {
          "$ref": "#/$defs/ExperimentWarehouseNativeMathType"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "How to aggregate the rows per entity. Defaults to `total` (row count)."
    },
    "math_property": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The numeric column `math` reads. Required when `math` is `sum`. One SQL relation can serve several metrics, each reading a different column.",
      "title": "Math Property"
    },
    "query": {
      "description": "Read-only SQL in the warehouse's dialect, returning one row per outcome with `entity_id` and `timestamp` columns plus any numeric columns a metric can measure.",
      "title": "Query",
      "type": "string"
    },
    "response": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Response"
    },
    "version": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "version of the node, used for schema migrations",
      "title": "Version"
    }
  },
  "required": [
    "connection_id",
    "query"
  ],
  "title": "ExperimentWarehouseNativeNode",
  "type": "object"
},
"FeaturePropertyFilter": {
  "additionalProperties": false,
  "properties": {
    "key": {
      "title": "Key",
      "type": "string"
    },
    "label": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Label"
    },
    "operator": {
      "$ref": "#/$defs/PropertyOperator"
    },
    "type": {
      "const": "feature",
      "default": "feature",
      "description": "Event property with \"$feature/\" prepended",
      "title": "Type",
      "type": "string"
    },
    "value": {
      "anyOf": [
        {
          "items": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              }
            ]
          },
          "type": "array"
        },
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Value"
    }
  },
  "required": [
    "key",
    "operator"
  ],
  "title": "FeaturePropertyFilter",
  "type": "object"
},
"FlagPropertyFilter": {
  "additionalProperties": false,
  "properties": {
    "key": {
      "description": "The key should be the flag ID",
      "title": "Key",
      "type": "string"
    },
    "label": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Label"
    },
    "operator": {
      "const": "flag_evaluates_to",
      "default": "flag_evaluates_to",
      "description": "Only flag_evaluates_to operator is allowed for flag dependencies",
      "title": "Operator",
      "type": "string"
    },
    "type": {
      "const": "flag",
      "default": "flag",
      "description": "Feature flag dependency",
      "title": "Type",
      "type": "string"
    },
    "value": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "string"
        }
      ],
      "description": "The value can be true, false, or a variant name",
      "title": "Value"
    }
  },
  "required": [
    "key",
    "value"
  ],
  "title": "FlagPropertyFilter",
  "type": "object"
},
"FunnelConversionWindowTimeUnit": {
  "enum": [
    "second",
    "minute",
    "hour",
    "day",
    "week",
    "month"
  ],
  "title": "FunnelConversionWindowTimeUnit",
  "type": "string"
},
"FunnelMathType": {
  "enum": [
    "total",
    "first_time_for_user",
    "first_time_for_user_with_filters"
  ],
  "title": "FunnelMathType",
  "type": "string"
},
"GroupMathType": {
  "enum": [
    "unique_group",
    "first_time_for_group",
    "first_matching_event_for_group"
  ],
  "title": "GroupMathType",
  "type": "string"
},
"GroupPropertyFilter": {
  "additionalProperties": false,
  "properties": {
    "group_key_names": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Group Key Names"
    },
    "group_type_index": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Group Type Index"
    },
    "key": {
      "title": "Key",
      "type": "string"
    },
    "label": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Label"
    },
    "operator": {
      "$ref": "#/$defs/PropertyOperator"
    },
    "type": {
      "const": "group",
      "default": "group",
      "title": "Type",
      "type": "string"
    },
    "value": {
      "anyOf": [
        {
          "items": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              }
            ]
          },
          "type": "array"
        },
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Value"
    }
  },
  "required": [
    "key",
    "operator"
  ],
  "title": "GroupPropertyFilter",
  "type": "object"
},
"HogQLPropertyFilter": {
  "additionalProperties": false,
  "properties": {
    "key": {
      "title": "Key",
      "type": "string"
    },
    "label": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Label"
    },
    "type": {
      "const": "hogql",
      "default": "hogql",
      "title": "Type",
      "type": "string"
    },
    "value": {
      "anyOf": [
        {
          "items": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              }
            ]
          },
          "type": "array"
        },
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Value"
    }
  },
  "required": [
    "key"
  ],
  "title": "HogQLPropertyFilter",
  "type": "object"
},
"InlineBehavioralType": {
  "enum": [
    "performed_event",
    "performed_event_multiple"
  ],
  "title": "InlineBehavioralType",
  "type": "string"
},
"Key10": {
  "enum": [
    "tag_name",
    "text",
    "href",
    "selector"
  ],
  "title": "Key10",
  "type": "string"
},
"LogEntryPropertyFilter": {
  "additionalProperties": false,
  "properties": {
    "key": {
      "title": "Key",
      "type": "string"
    },
    "label": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Label"
    },
    "operator": {
      "$ref": "#/$defs/PropertyOperator"
    },
    "type": {
      "const": "log_entry",
      "default": "log_entry",
      "title": "Type",
      "type": "string"
    },
    "value": {
      "anyOf": [
        {
          "items": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              }
            ]
          },
          "type": "array"
        },
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Value"
    }
  },
  "required": [
    "key",
    "operator"
  ],
  "title": "LogEntryPropertyFilter",
  "type": "object"
},
"LogPropertyFilter": {
  "additionalProperties": false,
  "properties": {
    "key": {
      "title": "Key",
      "type": "string"
    },
    "label": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Label"
    },
    "operator": {
      "$ref": "#/$defs/PropertyOperator"
    },
    "type": {
      "$ref": "#/$defs/LogPropertyFilterType"
    },
    "value": {
      "anyOf": [
        {
          "items": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              }
            ]
          },
          "type": "array"
        },
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Value"
    }
  },
  "required": [
    "key",
    "operator",
    "type"
  ],
  "title": "LogPropertyFilter",
  "type": "object"
},
"LogPropertyFilterType": {
  "enum": [
    "log",
    "log_attribute",
    "log_resource_attribute"
  ],
  "title": "LogPropertyFilterType",
  "type": "string"
},
"MathGroupTypeIndex": {
  "enum": [
    0.0,
    1.0,
    2.0,
    3.0,
    4.0
  ],
  "title": "MathGroupTypeIndex",
  "type": "number"
},
"MetricPropertyFilter": {
  "