mirror of
https://github.com/hanzoai/insights.git
synced 2026-11-03 00:52:32 +00:00
The tree was a debranded snapshot of upstream taken around 2026-02-20, and upstream has moved about five months since. This replaces it with upstream master, mechanically re-derived: bin/debrand does the rename, and the pipeline and squashed migrations are restored from the shipped tree. Not a merge. The previous import replaced the tree wholesale in a single commit, so there is no shared content history to merge against. Reproducing the rename on the new tree is what actually converges. What survives: .hanzo/workflows, the Dockerfiles and bin/docker* entrypoints, compose files, LLM.md, and insights/migrations. The squashed initial migration is load-bearing — the live database records it by name, so upstream's ~918 individual migrations cannot come back. Nine products are dropped as unreferenced. Twenty-one more that we do not run are kept anyway because the core app still imports them; unpicking those is a refactor and does not belong in a rebase. This base does not build yet, and the reasons are not in the rename: upstream now wants Python 3.13.13 against our 3.12.12 and Django 5.2 against our 4.2, and the dependency manifests still name upstream packages that we republish under our own names. Those are decisions, not renames.
3738 lines
293 KiB
JSON
3738 lines
293 KiB
JSON
{
|
||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||
"properties": {
|
||
"aggregation_group_type_index": {
|
||
"anyOf": [
|
||
{
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Groups aggregation"
|
||
},
|
||
"breakdownFilter": {
|
||
"description": "Breakdowns are used to segment data by property values of maximum three properties. They divide all defined trends series to multiple subseries based on the values of the property. Include breakdowns **only when they are essential to directly answer the user’s question**. You must not add breakdowns if the question can be addressed without additional segmentation. Always use the minimum set of breakdowns needed to answer the question. When using breakdowns, you must:\n- **Identify the property group** and name for each breakdown.\n- **Provide the property name** for each breakdown.\n- **Validate that the property value accurately reflects the intended criteria**. Examples of using breakdowns:\n- page views trend by country: you need to find a property such as `$geoip_country_code` and set it as a breakdown.\n- number of users who have completed onboarding by an organization: you need to find a property such as `organization name` and set it as a breakdown.",
|
||
"properties": {
|
||
"breakdown_limit": {
|
||
"default": 25,
|
||
"description": "How many distinct values to show.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"breakdown_path_cleaning": {
|
||
"description": "When `true`, applies the project's configured path cleaning rules to URL or path breakdown values (e.g. `$pathname`, `$current_url`). Use this whenever the user asks for a breakdown by a URL or path property and there is no specific reason to keep the raw values. The user does not need to provide a regex — path cleaning rules come from the project's settings.",
|
||
"type": "boolean"
|
||
},
|
||
"breakdowns": {
|
||
"description": "Use this field to define breakdowns.",
|
||
"items": {
|
||
"anyOf": [
|
||
{
|
||
"properties": {
|
||
"group_type_index": {
|
||
"anyOf": [
|
||
{
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "Index of the group type from the group mapping."
|
||
},
|
||
"property": {
|
||
"description": "Property name from the plan to break down by.",
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "group",
|
||
"default": "group",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["property"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"property": {
|
||
"description": "Property name from the plan to break down by.",
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"enum": [
|
||
"person",
|
||
"event",
|
||
"event_metadata",
|
||
"session",
|
||
"insightsql",
|
||
"cohort",
|
||
"revenue_analytics",
|
||
"data_warehouse",
|
||
"data_warehouse_person_property"
|
||
],
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["property", "type"],
|
||
"type": "object"
|
||
}
|
||
]
|
||
},
|
||
"maxItems": 3,
|
||
"type": "array"
|
||
}
|
||
},
|
||
"required": ["breakdowns"],
|
||
"type": "object"
|
||
},
|
||
"compareFilter": {
|
||
"description": "Compare to date range",
|
||
"properties": {
|
||
"compare": {
|
||
"default": false,
|
||
"description": "Whether to compare the current date range to a previous date range.",
|
||
"type": "boolean"
|
||
},
|
||
"compare_to": {
|
||
"description": "The date range to compare to. The value is a relative date. Examples of relative dates are: `-1y` for 1 year ago, `-14m` for 14 months ago, `-100w` for 100 weeks ago, `-14d` for 14 days ago, `-30h` for 30 hours ago.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"type": "object"
|
||
},
|
||
"dateRange": {
|
||
"anyOf": [
|
||
{
|
||
"properties": {
|
||
"date_from": {
|
||
"description": "ISO8601 date string.",
|
||
"type": "string"
|
||
},
|
||
"date_to": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "ISO8601 date string."
|
||
}
|
||
},
|
||
"required": ["date_from"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"date_from": {
|
||
"description": "Duration in the past. Supported units are: `h` (hour), `d` (day), `w` (week), `m` (month), `y` (year), `all` (all time). Use the `Start` suffix to define the exact left date boundary. Examples: `-1d` last day from now, `-180d` last 180 days from now, `mStart` this month start, `-1dStart` yesterday's start.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["date_from"],
|
||
"type": "object"
|
||
}
|
||
],
|
||
"description": "Date range for the query"
|
||
},
|
||
"filterTestAccounts": {
|
||
"description": "Exclude internal and test users by applying the respective filters. When omitted, follows the project's \"Filter out internal and test users\" default setting.",
|
||
"type": "boolean"
|
||
},
|
||
"interval": {
|
||
"default": "day",
|
||
"description": "Granularity of the response. Can be one of `hour`, `day`, `week` or `month`",
|
||
"enum": ["second", "minute", "hour", "day", "week", "month", "quarter", "year"],
|
||
"type": "string"
|
||
},
|
||
"kind": {
|
||
"const": "TrendsQuery",
|
||
"default": "TrendsQuery",
|
||
"type": "string"
|
||
},
|
||
"output_format": {
|
||
"default": "optimized",
|
||
"description": "Output format. \"optimized\" returns a human-readable summary from server-side formatters (recommended for analysis). \"json\" returns the raw query results as JSON.",
|
||
"enum": ["optimized", "json"],
|
||
"type": "string"
|
||
},
|
||
"properties": {
|
||
"default": [],
|
||
"description": "Property filters for all series",
|
||
"items": {
|
||
"anyOf": [
|
||
{
|
||
"anyOf": [
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
|
||
"enum": ["exact", "is_not", "icontains", "not_icontains", "regex", "not_regex"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"enum": ["event", "person", "session", "feature"],
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid Datastore regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "type", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": ["exact", "gt", "lt"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"enum": ["event", "person", "session", "feature"],
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"type": "number"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "type", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
|
||
"enum": ["exact", "is_not"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"enum": ["event", "person", "session", "feature"],
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"type": "array"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "type", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": ["is_date_exact", "is_date_before", "is_date_after"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"enum": ["event", "person", "session", "feature"],
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Value must be a date in ISO 8601 format.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "type", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
|
||
"enum": ["is_set", "is_not_set"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"enum": ["event", "person", "session", "feature"],
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "type"],
|
||
"type": "object"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"anyOf": [
|
||
{
|
||
"properties": {
|
||
"group_type_index": {
|
||
"description": "Index of the group type from the group mapping.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
|
||
"enum": ["exact", "is_not", "icontains", "not_icontains", "regex", "not_regex"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "group",
|
||
"default": "group",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid Datastore regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["group_type_index", "key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"group_type_index": {
|
||
"description": "Index of the group type from the group mapping.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": ["exact", "gt", "lt"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "group",
|
||
"default": "group",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"type": "number"
|
||
}
|
||
},
|
||
"required": ["group_type_index", "key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"group_type_index": {
|
||
"description": "Index of the group type from the group mapping.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
|
||
"enum": ["exact", "is_not"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "group",
|
||
"default": "group",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"type": "array"
|
||
}
|
||
},
|
||
"required": ["group_type_index", "key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"group_type_index": {
|
||
"description": "Index of the group type from the group mapping.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": ["is_date_exact", "is_date_before", "is_date_after"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "group",
|
||
"default": "group",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Value must be a date in ISO 8601 format.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["group_type_index", "key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"group_type_index": {
|
||
"description": "Index of the group type from the group mapping.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
|
||
"enum": ["is_set", "is_not_set"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "group",
|
||
"default": "group",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["group_type_index", "key", "operator"],
|
||
"type": "object"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"const": "id",
|
||
"default": "id",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"default": "in",
|
||
"enum": ["in", "not_in"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "cohort",
|
||
"default": "cohort",
|
||
"description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "The cohort ID to filter by.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
}
|
||
},
|
||
"required": ["value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"anyOf": [
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
|
||
"enum": ["tag_name", "text", "href", "selector"],
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
|
||
"enum": ["exact", "is_not", "icontains", "not_icontains", "regex", "not_regex"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "element",
|
||
"default": "element",
|
||
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid Datastore regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
|
||
"enum": ["tag_name", "text", "href", "selector"],
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": ["exact", "gt", "lt"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "element",
|
||
"default": "element",
|
||
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"type": "number"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
|
||
"enum": ["tag_name", "text", "href", "selector"],
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
|
||
"enum": ["exact", "is_not"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "element",
|
||
"default": "element",
|
||
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"type": "array"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
|
||
"enum": ["tag_name", "text", "href", "selector"],
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": ["is_date_exact", "is_date_before", "is_date_after"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "element",
|
||
"default": "element",
|
||
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Value must be a date in ISO 8601 format.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
|
||
"enum": ["tag_name", "text", "href", "selector"],
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
|
||
"enum": ["is_set", "is_not_set"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "element",
|
||
"default": "element",
|
||
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key", "operator"],
|
||
"type": "object"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "A InsightsQL boolean expression used as a filter condition.\n\nExamples:\n- Filter where a property exceeds a threshold: `toFloat(properties.load_time) > 5.0`\n- Filter with string matching: `properties.$current_url LIKE '%/pricing%'`\n- Filter with multiple conditions: `properties.$browser = 'Chrome' AND toFloat(properties.duration) > 30`",
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "insightsql",
|
||
"default": "insightsql",
|
||
"description": "Filter by a InsightsQL boolean expression for advanced filtering that can't be expressed with standard property filters.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The feature flag key.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"const": "flag_evaluates_to",
|
||
"default": "flag_evaluates_to",
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "flag",
|
||
"default": "flag",
|
||
"description": "Filter events by feature flag state — only include events where a specific flag evaluated to a given value. Examples:\n- Flag enabled: `{ type: \"flag\", key: \"new-onboarding\", operator: \"flag_evaluates_to\", value: true }`\n- Specific variant: `{ type: \"flag\", key: \"checkout-experiment\", operator: \"flag_evaluates_to\", value: \"variant-a\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"anyOf": [
|
||
{
|
||
"type": "boolean"
|
||
},
|
||
{
|
||
"type": "string"
|
||
}
|
||
],
|
||
"description": "`true`/`false` for boolean flags, or a variant name string for multivariate flags."
|
||
}
|
||
},
|
||
"required": ["key", "value"],
|
||
"type": "object"
|
||
}
|
||
]
|
||
},
|
||
"type": "array"
|
||
},
|
||
"series": {
|
||
"description": "Events, actions, or groups of events/actions to include. Prioritize the more popular and fresh events and actions.\n\nUse a top-level `EventsNode` or `ActionsNode` entry for each independent series (one line per entry on the chart). Use an `AssistantTrendsGroupNode` to combine multiple events or actions into a single series joined by `OR` — for example, treating \"Pageview OR Pageleave\" as one line. Only `OR` grouping is supported; pick groups only when the user wants the events counted together, otherwise prefer separate series.",
|
||
"items": {
|
||
"anyOf": [
|
||
{
|
||
"properties": {
|
||
"custom_name": {
|
||
"type": "string"
|
||
},
|
||
"event": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "The event or `null` for all events."
|
||
},
|
||
"kind": {
|
||
"const": "EventsNode",
|
||
"default": "EventsNode",
|
||
"type": "string"
|
||
},
|
||
"math": {
|
||
"anyOf": [
|
||
{
|
||
"enum": [
|
||
"total",
|
||
"dau",
|
||
"weekly_active",
|
||
"monthly_active",
|
||
"unique_session",
|
||
"first_time_for_user",
|
||
"first_matching_event_for_user"
|
||
],
|
||
"type": "string"
|
||
},
|
||
{
|
||
"enum": ["total", "first_time_for_user", "first_time_for_user_with_filters"],
|
||
"type": "string"
|
||
},
|
||
{
|
||
"enum": ["avg", "sum", "min", "max", "median", "p75", "p90", "p95", "p99"],
|
||
"type": "string"
|
||
},
|
||
{
|
||
"enum": [
|
||
"avg_count_per_actor",
|
||
"min_count_per_actor",
|
||
"max_count_per_actor",
|
||
"median_count_per_actor",
|
||
"p75_count_per_actor",
|
||
"p90_count_per_actor",
|
||
"p95_count_per_actor",
|
||
"p99_count_per_actor"
|
||
],
|
||
"type": "string"
|
||
},
|
||
{
|
||
"const": "unique_group",
|
||
"type": "string"
|
||
},
|
||
{
|
||
"const": "insightsql",
|
||
"type": "string"
|
||
},
|
||
{
|
||
"enum": [
|
||
"total",
|
||
"sum",
|
||
"unique_session",
|
||
"min",
|
||
"max",
|
||
"avg",
|
||
"dau",
|
||
"unique_group",
|
||
"insightsql"
|
||
],
|
||
"type": "string"
|
||
},
|
||
{
|
||
"enum": ["total", "dau"],
|
||
"type": "string"
|
||
}
|
||
]
|
||
},
|
||
"math_group_type_index": {
|
||
"anyOf": [
|
||
{
|
||
"const": 0,
|
||
"type": "number"
|
||
},
|
||
{
|
||
"const": 1,
|
||
"type": "number"
|
||
},
|
||
{
|
||
"const": 2,
|
||
"type": "number"
|
||
},
|
||
{
|
||
"const": 3,
|
||
"type": "number"
|
||
},
|
||
{
|
||
"const": 4,
|
||
"type": "number"
|
||
}
|
||
]
|
||
},
|
||
"math_insightsql": {
|
||
"description": "Custom InsightsQL expression for aggregation. Use when the predefined `math` types are not sufficient. When set, `math` must be set to `insightsql`.\n\nExamples:\n- Sum a numeric property: `sum(toFloat(properties.$revenue))`\n- Average of a property: `avg(toFloat(properties.load_time))`\n- Count distinct values: `count(distinct properties.$session_id)`\n- Conditional count: `countIf(toFloat(properties.duration) > 30)`\n- Percentile: `quantile(0.95)(toFloat(properties.response_time))`",
|
||
"type": "string"
|
||
},
|
||
"math_multiplier": {
|
||
"type": "number"
|
||
},
|
||
"math_property": {
|
||
"type": "string"
|
||
},
|
||
"math_property_type": {
|
||
"type": "string"
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
},
|
||
"optionalInFunnel": {
|
||
"type": "boolean"
|
||
},
|
||
"properties": {
|
||
"items": {
|
||
"anyOf": [
|
||
{
|
||
"anyOf": [
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
|
||
"enum": [
|
||
"exact",
|
||
"is_not",
|
||
"icontains",
|
||
"not_icontains",
|
||
"regex",
|
||
"not_regex"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"enum": ["event", "person", "session", "feature"],
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid Datastore regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "type", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": ["exact", "gt", "lt"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"enum": ["event", "person", "session", "feature"],
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"type": "number"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "type", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
|
||
"enum": ["exact", "is_not"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"enum": ["event", "person", "session", "feature"],
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"type": "array"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "type", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": [
|
||
"is_date_exact",
|
||
"is_date_before",
|
||
"is_date_after"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"enum": ["event", "person", "session", "feature"],
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Value must be a date in ISO 8601 format.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "type", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
|
||
"enum": ["is_set", "is_not_set"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"enum": ["event", "person", "session", "feature"],
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "type"],
|
||
"type": "object"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"anyOf": [
|
||
{
|
||
"properties": {
|
||
"group_type_index": {
|
||
"description": "Index of the group type from the group mapping.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
|
||
"enum": [
|
||
"exact",
|
||
"is_not",
|
||
"icontains",
|
||
"not_icontains",
|
||
"regex",
|
||
"not_regex"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "group",
|
||
"default": "group",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid Datastore regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["group_type_index", "key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"group_type_index": {
|
||
"description": "Index of the group type from the group mapping.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": ["exact", "gt", "lt"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "group",
|
||
"default": "group",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"type": "number"
|
||
}
|
||
},
|
||
"required": ["group_type_index", "key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"group_type_index": {
|
||
"description": "Index of the group type from the group mapping.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
|
||
"enum": ["exact", "is_not"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "group",
|
||
"default": "group",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"type": "array"
|
||
}
|
||
},
|
||
"required": ["group_type_index", "key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"group_type_index": {
|
||
"description": "Index of the group type from the group mapping.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": [
|
||
"is_date_exact",
|
||
"is_date_before",
|
||
"is_date_after"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "group",
|
||
"default": "group",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Value must be a date in ISO 8601 format.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["group_type_index", "key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"group_type_index": {
|
||
"description": "Index of the group type from the group mapping.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
|
||
"enum": ["is_set", "is_not_set"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "group",
|
||
"default": "group",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["group_type_index", "key", "operator"],
|
||
"type": "object"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"const": "id",
|
||
"default": "id",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"default": "in",
|
||
"enum": ["in", "not_in"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "cohort",
|
||
"default": "cohort",
|
||
"description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "The cohort ID to filter by.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
}
|
||
},
|
||
"required": ["value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"anyOf": [
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
|
||
"enum": ["tag_name", "text", "href", "selector"],
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
|
||
"enum": [
|
||
"exact",
|
||
"is_not",
|
||
"icontains",
|
||
"not_icontains",
|
||
"regex",
|
||
"not_regex"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "element",
|
||
"default": "element",
|
||
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid Datastore regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
|
||
"enum": ["tag_name", "text", "href", "selector"],
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": ["exact", "gt", "lt"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "element",
|
||
"default": "element",
|
||
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"type": "number"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
|
||
"enum": ["tag_name", "text", "href", "selector"],
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
|
||
"enum": ["exact", "is_not"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "element",
|
||
"default": "element",
|
||
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"type": "array"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
|
||
"enum": ["tag_name", "text", "href", "selector"],
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": [
|
||
"is_date_exact",
|
||
"is_date_before",
|
||
"is_date_after"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "element",
|
||
"default": "element",
|
||
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Value must be a date in ISO 8601 format.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
|
||
"enum": ["tag_name", "text", "href", "selector"],
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
|
||
"enum": ["is_set", "is_not_set"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "element",
|
||
"default": "element",
|
||
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key", "operator"],
|
||
"type": "object"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "A InsightsQL boolean expression used as a filter condition.\n\nExamples:\n- Filter where a property exceeds a threshold: `toFloat(properties.load_time) > 5.0`\n- Filter with string matching: `properties.$current_url LIKE '%/pricing%'`\n- Filter with multiple conditions: `properties.$browser = 'Chrome' AND toFloat(properties.duration) > 30`",
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "insightsql",
|
||
"default": "insightsql",
|
||
"description": "Filter by a InsightsQL boolean expression for advanced filtering that can't be expressed with standard property filters.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The feature flag key.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"const": "flag_evaluates_to",
|
||
"default": "flag_evaluates_to",
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "flag",
|
||
"default": "flag",
|
||
"description": "Filter events by feature flag state — only include events where a specific flag evaluated to a given value. Examples:\n- Flag enabled: `{ type: \"flag\", key: \"new-onboarding\", operator: \"flag_evaluates_to\", value: true }`\n- Specific variant: `{ type: \"flag\", key: \"checkout-experiment\", operator: \"flag_evaluates_to\", value: \"variant-a\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"anyOf": [
|
||
{
|
||
"type": "boolean"
|
||
},
|
||
{
|
||
"type": "string"
|
||
}
|
||
],
|
||
"description": "`true`/`false` for boolean flags, or a variant name string for multivariate flags."
|
||
}
|
||
},
|
||
"required": ["key", "value"],
|
||
"type": "object"
|
||
}
|
||
]
|
||
},
|
||
"type": "array"
|
||
},
|
||
"version": {
|
||
"description": "version of the node, used for schema migrations",
|
||
"type": "number"
|
||
}
|
||
},
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"custom_name": {
|
||
"type": "string"
|
||
},
|
||
"id": {
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"kind": {
|
||
"const": "ActionsNode",
|
||
"default": "ActionsNode",
|
||
"type": "string"
|
||
},
|
||
"math": {
|
||
"anyOf": [
|
||
{
|
||
"enum": [
|
||
"total",
|
||
"dau",
|
||
"weekly_active",
|
||
"monthly_active",
|
||
"unique_session",
|
||
"first_time_for_user",
|
||
"first_matching_event_for_user"
|
||
],
|
||
"type": "string"
|
||
},
|
||
{
|
||
"enum": ["total", "first_time_for_user", "first_time_for_user_with_filters"],
|
||
"type": "string"
|
||
},
|
||
{
|
||
"enum": ["avg", "sum", "min", "max", "median", "p75", "p90", "p95", "p99"],
|
||
"type": "string"
|
||
},
|
||
{
|
||
"enum": [
|
||
"avg_count_per_actor",
|
||
"min_count_per_actor",
|
||
"max_count_per_actor",
|
||
"median_count_per_actor",
|
||
"p75_count_per_actor",
|
||
"p90_count_per_actor",
|
||
"p95_count_per_actor",
|
||
"p99_count_per_actor"
|
||
],
|
||
"type": "string"
|
||
},
|
||
{
|
||
"const": "unique_group",
|
||
"type": "string"
|
||
},
|
||
{
|
||
"const": "insightsql",
|
||
"type": "string"
|
||
},
|
||
{
|
||
"enum": [
|
||
"total",
|
||
"sum",
|
||
"unique_session",
|
||
"min",
|
||
"max",
|
||
"avg",
|
||
"dau",
|
||
"unique_group",
|
||
"insightsql"
|
||
],
|
||
"type": "string"
|
||
},
|
||
{
|
||
"enum": ["total", "dau"],
|
||
"type": "string"
|
||
}
|
||
]
|
||
},
|
||
"math_group_type_index": {
|
||
"anyOf": [
|
||
{
|
||
"const": 0,
|
||
"type": "number"
|
||
},
|
||
{
|
||
"const": 1,
|
||
"type": "number"
|
||
},
|
||
{
|
||
"const": 2,
|
||
"type": "number"
|
||
},
|
||
{
|
||
"const": 3,
|
||
"type": "number"
|
||
},
|
||
{
|
||
"const": 4,
|
||
"type": "number"
|
||
}
|
||
]
|
||
},
|
||
"math_insightsql": {
|
||
"description": "Custom InsightsQL expression for aggregation. Use when the predefined `math` types are not sufficient. When set, `math` must be set to `insightsql`.\n\nExamples:\n- Sum a numeric property: `sum(toFloat(properties.$revenue))`\n- Average of a property: `avg(toFloat(properties.load_time))`\n- Count distinct values: `count(distinct properties.$session_id)`\n- Conditional count: `countIf(toFloat(properties.duration) > 30)`\n- Percentile: `quantile(0.95)(toFloat(properties.response_time))`",
|
||
"type": "string"
|
||
},
|
||
"math_multiplier": {
|
||
"type": "number"
|
||
},
|
||
"math_property": {
|
||
"type": "string"
|
||
},
|
||
"math_property_type": {
|
||
"type": "string"
|
||
},
|
||
"name": {
|
||
"description": "Action name from the plan.",
|
||
"type": "string"
|
||
},
|
||
"optionalInFunnel": {
|
||
"type": "boolean"
|
||
},
|
||
"properties": {
|
||
"items": {
|
||
"anyOf": [
|
||
{
|
||
"anyOf": [
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
|
||
"enum": [
|
||
"exact",
|
||
"is_not",
|
||
"icontains",
|
||
"not_icontains",
|
||
"regex",
|
||
"not_regex"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"enum": ["event", "person", "session", "feature"],
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid Datastore regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "type", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": ["exact", "gt", "lt"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"enum": ["event", "person", "session", "feature"],
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"type": "number"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "type", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
|
||
"enum": ["exact", "is_not"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"enum": ["event", "person", "session", "feature"],
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"type": "array"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "type", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": [
|
||
"is_date_exact",
|
||
"is_date_before",
|
||
"is_date_after"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"enum": ["event", "person", "session", "feature"],
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Value must be a date in ISO 8601 format.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "type", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
|
||
"enum": ["is_set", "is_not_set"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"enum": ["event", "person", "session", "feature"],
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "type"],
|
||
"type": "object"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"anyOf": [
|
||
{
|
||
"properties": {
|
||
"group_type_index": {
|
||
"description": "Index of the group type from the group mapping.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
|
||
"enum": [
|
||
"exact",
|
||
"is_not",
|
||
"icontains",
|
||
"not_icontains",
|
||
"regex",
|
||
"not_regex"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "group",
|
||
"default": "group",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid Datastore regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["group_type_index", "key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"group_type_index": {
|
||
"description": "Index of the group type from the group mapping.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": ["exact", "gt", "lt"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "group",
|
||
"default": "group",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"type": "number"
|
||
}
|
||
},
|
||
"required": ["group_type_index", "key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"group_type_index": {
|
||
"description": "Index of the group type from the group mapping.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
|
||
"enum": ["exact", "is_not"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "group",
|
||
"default": "group",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"type": "array"
|
||
}
|
||
},
|
||
"required": ["group_type_index", "key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"group_type_index": {
|
||
"description": "Index of the group type from the group mapping.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": [
|
||
"is_date_exact",
|
||
"is_date_before",
|
||
"is_date_after"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "group",
|
||
"default": "group",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Value must be a date in ISO 8601 format.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["group_type_index", "key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"group_type_index": {
|
||
"description": "Index of the group type from the group mapping.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
|
||
"enum": ["is_set", "is_not_set"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "group",
|
||
"default": "group",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["group_type_index", "key", "operator"],
|
||
"type": "object"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"const": "id",
|
||
"default": "id",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"default": "in",
|
||
"enum": ["in", "not_in"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "cohort",
|
||
"default": "cohort",
|
||
"description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "The cohort ID to filter by.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
}
|
||
},
|
||
"required": ["value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"anyOf": [
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
|
||
"enum": ["tag_name", "text", "href", "selector"],
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
|
||
"enum": [
|
||
"exact",
|
||
"is_not",
|
||
"icontains",
|
||
"not_icontains",
|
||
"regex",
|
||
"not_regex"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "element",
|
||
"default": "element",
|
||
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid Datastore regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
|
||
"enum": ["tag_name", "text", "href", "selector"],
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": ["exact", "gt", "lt"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "element",
|
||
"default": "element",
|
||
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"type": "number"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
|
||
"enum": ["tag_name", "text", "href", "selector"],
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
|
||
"enum": ["exact", "is_not"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "element",
|
||
"default": "element",
|
||
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"type": "array"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
|
||
"enum": ["tag_name", "text", "href", "selector"],
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": [
|
||
"is_date_exact",
|
||
"is_date_before",
|
||
"is_date_after"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "element",
|
||
"default": "element",
|
||
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Value must be a date in ISO 8601 format.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
|
||
"enum": ["tag_name", "text", "href", "selector"],
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
|
||
"enum": ["is_set", "is_not_set"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "element",
|
||
"default": "element",
|
||
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key", "operator"],
|
||
"type": "object"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "A InsightsQL boolean expression used as a filter condition.\n\nExamples:\n- Filter where a property exceeds a threshold: `toFloat(properties.load_time) > 5.0`\n- Filter with string matching: `properties.$current_url LIKE '%/pricing%'`\n- Filter with multiple conditions: `properties.$browser = 'Chrome' AND toFloat(properties.duration) > 30`",
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "insightsql",
|
||
"default": "insightsql",
|
||
"description": "Filter by a InsightsQL boolean expression for advanced filtering that can't be expressed with standard property filters.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The feature flag key.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"const": "flag_evaluates_to",
|
||
"default": "flag_evaluates_to",
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "flag",
|
||
"default": "flag",
|
||
"description": "Filter events by feature flag state — only include events where a specific flag evaluated to a given value. Examples:\n- Flag enabled: `{ type: \"flag\", key: \"new-onboarding\", operator: \"flag_evaluates_to\", value: true }`\n- Specific variant: `{ type: \"flag\", key: \"checkout-experiment\", operator: \"flag_evaluates_to\", value: \"variant-a\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"anyOf": [
|
||
{
|
||
"type": "boolean"
|
||
},
|
||
{
|
||
"type": "string"
|
||
}
|
||
],
|
||
"description": "`true`/`false` for boolean flags, or a variant name string for multivariate flags."
|
||
}
|
||
},
|
||
"required": ["key", "value"],
|
||
"type": "object"
|
||
}
|
||
]
|
||
},
|
||
"type": "array"
|
||
},
|
||
"version": {
|
||
"description": "version of the node, used for schema migrations",
|
||
"type": "number"
|
||
}
|
||
},
|
||
"required": ["id", "name"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"custom_name": {
|
||
"type": "string"
|
||
},
|
||
"kind": {
|
||
"const": "GroupNode",
|
||
"default": "GroupNode",
|
||
"type": "string"
|
||
},
|
||
"math": {
|
||
"anyOf": [
|
||
{
|
||
"enum": [
|
||
"total",
|
||
"dau",
|
||
"weekly_active",
|
||
"monthly_active",
|
||
"unique_session",
|
||
"first_time_for_user",
|
||
"first_matching_event_for_user"
|
||
],
|
||
"type": "string"
|
||
},
|
||
{
|
||
"enum": ["total", "first_time_for_user", "first_time_for_user_with_filters"],
|
||
"type": "string"
|
||
},
|
||
{
|
||
"enum": ["avg", "sum", "min", "max", "median", "p75", "p90", "p95", "p99"],
|
||
"type": "string"
|
||
},
|
||
{
|
||
"enum": [
|
||
"avg_count_per_actor",
|
||
"min_count_per_actor",
|
||
"max_count_per_actor",
|
||
"median_count_per_actor",
|
||
"p75_count_per_actor",
|
||
"p90_count_per_actor",
|
||
"p95_count_per_actor",
|
||
"p99_count_per_actor"
|
||
],
|
||
"type": "string"
|
||
},
|
||
{
|
||
"const": "unique_group",
|
||
"type": "string"
|
||
},
|
||
{
|
||
"const": "insightsql",
|
||
"type": "string"
|
||
},
|
||
{
|
||
"enum": [
|
||
"total",
|
||
"sum",
|
||
"unique_session",
|
||
"min",
|
||
"max",
|
||
"avg",
|
||
"dau",
|
||
"unique_group",
|
||
"insightsql"
|
||
],
|
||
"type": "string"
|
||
},
|
||
{
|
||
"enum": ["total", "dau"],
|
||
"type": "string"
|
||
}
|
||
],
|
||
"description": "Math aggregation for the combined series. The engine reads aggregation from here, not from inner nodes."
|
||
},
|
||
"math_group_type_index": {
|
||
"anyOf": [
|
||
{
|
||
"const": 0,
|
||
"type": "number"
|
||
},
|
||
{
|
||
"const": 1,
|
||
"type": "number"
|
||
},
|
||
{
|
||
"const": 2,
|
||
"type": "number"
|
||
},
|
||
{
|
||
"const": 3,
|
||
"type": "number"
|
||
},
|
||
{
|
||
"const": 4,
|
||
"type": "number"
|
||
}
|
||
]
|
||
},
|
||
"math_insightsql": {
|
||
"description": "Custom InsightsQL aggregation. When set, `math` must be `insightsql`.",
|
||
"type": "string"
|
||
},
|
||
"math_multiplier": {
|
||
"type": "number"
|
||
},
|
||
"math_property": {
|
||
"type": "string"
|
||
},
|
||
"math_property_type": {
|
||
"type": "string"
|
||
},
|
||
"name": {
|
||
"description": "Display name for the combined series.",
|
||
"type": "string"
|
||
},
|
||
"nodes": {
|
||
"description": "Events and actions combined into the series. Mirror the group's `math*` on each node for UI round-trip; they're ignored at execution time.",
|
||
"items": {
|
||
"anyOf": [
|
||
{
|
||
"properties": {
|
||
"custom_name": {
|
||
"type": "string"
|
||
},
|
||
"event": {
|
||
"anyOf": [
|
||
{
|
||
"type": "string"
|
||
},
|
||
{
|
||
"type": "null"
|
||
}
|
||
],
|
||
"description": "The event or `null` for all events."
|
||
},
|
||
"kind": {
|
||
"const": "EventsNode",
|
||
"default": "EventsNode",
|
||
"type": "string"
|
||
},
|
||
"math": {
|
||
"anyOf": [
|
||
{
|
||
"enum": [
|
||
"total",
|
||
"dau",
|
||
"weekly_active",
|
||
"monthly_active",
|
||
"unique_session",
|
||
"first_time_for_user",
|
||
"first_matching_event_for_user"
|
||
],
|
||
"type": "string"
|
||
},
|
||
{
|
||
"enum": [
|
||
"total",
|
||
"first_time_for_user",
|
||
"first_time_for_user_with_filters"
|
||
],
|
||
"type": "string"
|
||
},
|
||
{
|
||
"enum": [
|
||
"avg",
|
||
"sum",
|
||
"min",
|
||
"max",
|
||
"median",
|
||
"p75",
|
||
"p90",
|
||
"p95",
|
||
"p99"
|
||
],
|
||
"type": "string"
|
||
},
|
||
{
|
||
"enum": [
|
||
"avg_count_per_actor",
|
||
"min_count_per_actor",
|
||
"max_count_per_actor",
|
||
"median_count_per_actor",
|
||
"p75_count_per_actor",
|
||
"p90_count_per_actor",
|
||
"p95_count_per_actor",
|
||
"p99_count_per_actor"
|
||
],
|
||
"type": "string"
|
||
},
|
||
{
|
||
"const": "unique_group",
|
||
"type": "string"
|
||
},
|
||
{
|
||
"const": "insightsql",
|
||
"type": "string"
|
||
},
|
||
{
|
||
"enum": [
|
||
"total",
|
||
"sum",
|
||
"unique_session",
|
||
"min",
|
||
"max",
|
||
"avg",
|
||
"dau",
|
||
"unique_group",
|
||
"insightsql"
|
||
],
|
||
"type": "string"
|
||
},
|
||
{
|
||
"enum": ["total", "dau"],
|
||
"type": "string"
|
||
}
|
||
]
|
||
},
|
||
"math_group_type_index": {
|
||
"anyOf": [
|
||
{
|
||
"const": 0,
|
||
"type": "number"
|
||
},
|
||
{
|
||
"const": 1,
|
||
"type": "number"
|
||
},
|
||
{
|
||
"const": 2,
|
||
"type": "number"
|
||
},
|
||
{
|
||
"const": 3,
|
||
"type": "number"
|
||
},
|
||
{
|
||
"const": 4,
|
||
"type": "number"
|
||
}
|
||
]
|
||
},
|
||
"math_insightsql": {
|
||
"description": "Custom InsightsQL expression for aggregation. Use when the predefined `math` types are not sufficient. When set, `math` must be set to `insightsql`.\n\nExamples:\n- Sum a numeric property: `sum(toFloat(properties.$revenue))`\n- Average of a property: `avg(toFloat(properties.load_time))`\n- Count distinct values: `count(distinct properties.$session_id)`\n- Conditional count: `countIf(toFloat(properties.duration) > 30)`\n- Percentile: `quantile(0.95)(toFloat(properties.response_time))`",
|
||
"type": "string"
|
||
},
|
||
"math_multiplier": {
|
||
"type": "number"
|
||
},
|
||
"math_property": {
|
||
"type": "string"
|
||
},
|
||
"math_property_type": {
|
||
"type": "string"
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
},
|
||
"optionalInFunnel": {
|
||
"type": "boolean"
|
||
},
|
||
"properties": {
|
||
"items": {
|
||
"anyOf": [
|
||
{
|
||
"anyOf": [
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
|
||
"enum": [
|
||
"exact",
|
||
"is_not",
|
||
"icontains",
|
||
"not_icontains",
|
||
"regex",
|
||
"not_regex"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"enum": [
|
||
"event",
|
||
"person",
|
||
"session",
|
||
"feature"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid Datastore regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": [
|
||
"key",
|
||
"operator",
|
||
"type",
|
||
"value"
|
||
],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": ["exact", "gt", "lt"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"enum": [
|
||
"event",
|
||
"person",
|
||
"session",
|
||
"feature"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"type": "number"
|
||
}
|
||
},
|
||
"required": [
|
||
"key",
|
||
"operator",
|
||
"type",
|
||
"value"
|
||
],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
|
||
"enum": ["exact", "is_not"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"enum": [
|
||
"event",
|
||
"person",
|
||
"session",
|
||
"feature"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"type": "array"
|
||
}
|
||
},
|
||
"required": [
|
||
"key",
|
||
"operator",
|
||
"type",
|
||
"value"
|
||
],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": [
|
||
"is_date_exact",
|
||
"is_date_before",
|
||
"is_date_after"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"enum": [
|
||
"event",
|
||
"person",
|
||
"session",
|
||
"feature"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Value must be a date in ISO 8601 format.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": [
|
||
"key",
|
||
"operator",
|
||
"type",
|
||
"value"
|
||
],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
|
||
"enum": ["is_set", "is_not_set"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"enum": [
|
||
"event",
|
||
"person",
|
||
"session",
|
||
"feature"
|
||
],
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "type"],
|
||
"type": "object"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"anyOf": [
|
||
{
|
||
"properties": {
|
||
"group_type_index": {
|
||
"description": "Index of the group type from the group mapping.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
|
||
"enum": [
|
||
"exact",
|
||
"is_not",
|
||
"icontains",
|
||
"not_icontains",
|
||
"regex",
|
||
"not_regex"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "group",
|
||
"default": "group",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid Datastore regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": [
|
||
"group_type_index",
|
||
"key",
|
||
"operator",
|
||
"value"
|
||
],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"group_type_index": {
|
||
"description": "Index of the group type from the group mapping.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": ["exact", "gt", "lt"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "group",
|
||
"default": "group",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"type": "number"
|
||
}
|
||
},
|
||
"required": [
|
||
"group_type_index",
|
||
"key",
|
||
"operator",
|
||
"value"
|
||
],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"group_type_index": {
|
||
"description": "Index of the group type from the group mapping.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
|
||
"enum": ["exact", "is_not"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "group",
|
||
"default": "group",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"type": "array"
|
||
}
|
||
},
|
||
"required": [
|
||
"group_type_index",
|
||
"key",
|
||
"operator",
|
||
"value"
|
||
],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"group_type_index": {
|
||
"description": "Index of the group type from the group mapping.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": [
|
||
"is_date_exact",
|
||
"is_date_before",
|
||
"is_date_after"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "group",
|
||
"default": "group",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Value must be a date in ISO 8601 format.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": [
|
||
"group_type_index",
|
||
"key",
|
||
"operator",
|
||
"value"
|
||
],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"group_type_index": {
|
||
"description": "Index of the group type from the group mapping.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
|
||
"enum": ["is_set", "is_not_set"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "group",
|
||
"default": "group",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": [
|
||
"group_type_index",
|
||
"key",
|
||
"operator"
|
||
],
|
||
"type": "object"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"const": "id",
|
||
"default": "id",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"default": "in",
|
||
"enum": ["in", "not_in"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "cohort",
|
||
"default": "cohort",
|
||
"description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "The cohort ID to filter by.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
}
|
||
},
|
||
"required": ["value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"anyOf": [
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
|
||
"enum": [
|
||
"tag_name",
|
||
"text",
|
||
"href",
|
||
"selector"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
|
||
"enum": [
|
||
"exact",
|
||
"is_not",
|
||
"icontains",
|
||
"not_icontains",
|
||
"regex",
|
||
"not_regex"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "element",
|
||
"default": "element",
|
||
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid Datastore regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
|
||
"enum": [
|
||
"tag_name",
|
||
"text",
|
||
"href",
|
||
"selector"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": ["exact", "gt", "lt"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "element",
|
||
"default": "element",
|
||
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"type": "number"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
|
||
"enum": [
|
||
"tag_name",
|
||
"text",
|
||
"href",
|
||
"selector"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
|
||
"enum": ["exact", "is_not"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "element",
|
||
"default": "element",
|
||
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"type": "array"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
|
||
"enum": [
|
||
"tag_name",
|
||
"text",
|
||
"href",
|
||
"selector"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": [
|
||
"is_date_exact",
|
||
"is_date_before",
|
||
"is_date_after"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "element",
|
||
"default": "element",
|
||
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Value must be a date in ISO 8601 format.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
|
||
"enum": [
|
||
"tag_name",
|
||
"text",
|
||
"href",
|
||
"selector"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
|
||
"enum": ["is_set", "is_not_set"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "element",
|
||
"default": "element",
|
||
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key", "operator"],
|
||
"type": "object"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "A InsightsQL boolean expression used as a filter condition.\n\nExamples:\n- Filter where a property exceeds a threshold: `toFloat(properties.load_time) > 5.0`\n- Filter with string matching: `properties.$current_url LIKE '%/pricing%'`\n- Filter with multiple conditions: `properties.$browser = 'Chrome' AND toFloat(properties.duration) > 30`",
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "insightsql",
|
||
"default": "insightsql",
|
||
"description": "Filter by a InsightsQL boolean expression for advanced filtering that can't be expressed with standard property filters.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The feature flag key.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"const": "flag_evaluates_to",
|
||
"default": "flag_evaluates_to",
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "flag",
|
||
"default": "flag",
|
||
"description": "Filter events by feature flag state — only include events where a specific flag evaluated to a given value. Examples:\n- Flag enabled: `{ type: \"flag\", key: \"new-onboarding\", operator: \"flag_evaluates_to\", value: true }`\n- Specific variant: `{ type: \"flag\", key: \"checkout-experiment\", operator: \"flag_evaluates_to\", value: \"variant-a\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"anyOf": [
|
||
{
|
||
"type": "boolean"
|
||
},
|
||
{
|
||
"type": "string"
|
||
}
|
||
],
|
||
"description": "`true`/`false` for boolean flags, or a variant name string for multivariate flags."
|
||
}
|
||
},
|
||
"required": ["key", "value"],
|
||
"type": "object"
|
||
}
|
||
]
|
||
},
|
||
"type": "array"
|
||
},
|
||
"version": {
|
||
"description": "version of the node, used for schema migrations",
|
||
"type": "number"
|
||
}
|
||
},
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"custom_name": {
|
||
"type": "string"
|
||
},
|
||
"id": {
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"kind": {
|
||
"const": "ActionsNode",
|
||
"default": "ActionsNode",
|
||
"type": "string"
|
||
},
|
||
"math": {
|
||
"anyOf": [
|
||
{
|
||
"enum": [
|
||
"total",
|
||
"dau",
|
||
"weekly_active",
|
||
"monthly_active",
|
||
"unique_session",
|
||
"first_time_for_user",
|
||
"first_matching_event_for_user"
|
||
],
|
||
"type": "string"
|
||
},
|
||
{
|
||
"enum": [
|
||
"total",
|
||
"first_time_for_user",
|
||
"first_time_for_user_with_filters"
|
||
],
|
||
"type": "string"
|
||
},
|
||
{
|
||
"enum": [
|
||
"avg",
|
||
"sum",
|
||
"min",
|
||
"max",
|
||
"median",
|
||
"p75",
|
||
"p90",
|
||
"p95",
|
||
"p99"
|
||
],
|
||
"type": "string"
|
||
},
|
||
{
|
||
"enum": [
|
||
"avg_count_per_actor",
|
||
"min_count_per_actor",
|
||
"max_count_per_actor",
|
||
"median_count_per_actor",
|
||
"p75_count_per_actor",
|
||
"p90_count_per_actor",
|
||
"p95_count_per_actor",
|
||
"p99_count_per_actor"
|
||
],
|
||
"type": "string"
|
||
},
|
||
{
|
||
"const": "unique_group",
|
||
"type": "string"
|
||
},
|
||
{
|
||
"const": "insightsql",
|
||
"type": "string"
|
||
},
|
||
{
|
||
"enum": [
|
||
"total",
|
||
"sum",
|
||
"unique_session",
|
||
"min",
|
||
"max",
|
||
"avg",
|
||
"dau",
|
||
"unique_group",
|
||
"insightsql"
|
||
],
|
||
"type": "string"
|
||
},
|
||
{
|
||
"enum": ["total", "dau"],
|
||
"type": "string"
|
||
}
|
||
]
|
||
},
|
||
"math_group_type_index": {
|
||
"anyOf": [
|
||
{
|
||
"const": 0,
|
||
"type": "number"
|
||
},
|
||
{
|
||
"const": 1,
|
||
"type": "number"
|
||
},
|
||
{
|
||
"const": 2,
|
||
"type": "number"
|
||
},
|
||
{
|
||
"const": 3,
|
||
"type": "number"
|
||
},
|
||
{
|
||
"const": 4,
|
||
"type": "number"
|
||
}
|
||
]
|
||
},
|
||
"math_insightsql": {
|
||
"description": "Custom InsightsQL expression for aggregation. Use when the predefined `math` types are not sufficient. When set, `math` must be set to `insightsql`.\n\nExamples:\n- Sum a numeric property: `sum(toFloat(properties.$revenue))`\n- Average of a property: `avg(toFloat(properties.load_time))`\n- Count distinct values: `count(distinct properties.$session_id)`\n- Conditional count: `countIf(toFloat(properties.duration) > 30)`\n- Percentile: `quantile(0.95)(toFloat(properties.response_time))`",
|
||
"type": "string"
|
||
},
|
||
"math_multiplier": {
|
||
"type": "number"
|
||
},
|
||
"math_property": {
|
||
"type": "string"
|
||
},
|
||
"math_property_type": {
|
||
"type": "string"
|
||
},
|
||
"name": {
|
||
"description": "Action name from the plan.",
|
||
"type": "string"
|
||
},
|
||
"optionalInFunnel": {
|
||
"type": "boolean"
|
||
},
|
||
"properties": {
|
||
"items": {
|
||
"anyOf": [
|
||
{
|
||
"anyOf": [
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
|
||
"enum": [
|
||
"exact",
|
||
"is_not",
|
||
"icontains",
|
||
"not_icontains",
|
||
"regex",
|
||
"not_regex"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"enum": [
|
||
"event",
|
||
"person",
|
||
"session",
|
||
"feature"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid Datastore regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": [
|
||
"key",
|
||
"operator",
|
||
"type",
|
||
"value"
|
||
],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": ["exact", "gt", "lt"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"enum": [
|
||
"event",
|
||
"person",
|
||
"session",
|
||
"feature"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"type": "number"
|
||
}
|
||
},
|
||
"required": [
|
||
"key",
|
||
"operator",
|
||
"type",
|
||
"value"
|
||
],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
|
||
"enum": ["exact", "is_not"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"enum": [
|
||
"event",
|
||
"person",
|
||
"session",
|
||
"feature"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"type": "array"
|
||
}
|
||
},
|
||
"required": [
|
||
"key",
|
||
"operator",
|
||
"type",
|
||
"value"
|
||
],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": [
|
||
"is_date_exact",
|
||
"is_date_before",
|
||
"is_date_after"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"enum": [
|
||
"event",
|
||
"person",
|
||
"session",
|
||
"feature"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Value must be a date in ISO 8601 format.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": [
|
||
"key",
|
||
"operator",
|
||
"type",
|
||
"value"
|
||
],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
|
||
"enum": ["is_set", "is_not_set"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"enum": [
|
||
"event",
|
||
"person",
|
||
"session",
|
||
"feature"
|
||
],
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "type"],
|
||
"type": "object"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"anyOf": [
|
||
{
|
||
"properties": {
|
||
"group_type_index": {
|
||
"description": "Index of the group type from the group mapping.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
|
||
"enum": [
|
||
"exact",
|
||
"is_not",
|
||
"icontains",
|
||
"not_icontains",
|
||
"regex",
|
||
"not_regex"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "group",
|
||
"default": "group",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid Datastore regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": [
|
||
"group_type_index",
|
||
"key",
|
||
"operator",
|
||
"value"
|
||
],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"group_type_index": {
|
||
"description": "Index of the group type from the group mapping.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": ["exact", "gt", "lt"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "group",
|
||
"default": "group",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"type": "number"
|
||
}
|
||
},
|
||
"required": [
|
||
"group_type_index",
|
||
"key",
|
||
"operator",
|
||
"value"
|
||
],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"group_type_index": {
|
||
"description": "Index of the group type from the group mapping.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
|
||
"enum": ["exact", "is_not"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "group",
|
||
"default": "group",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"type": "array"
|
||
}
|
||
},
|
||
"required": [
|
||
"group_type_index",
|
||
"key",
|
||
"operator",
|
||
"value"
|
||
],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"group_type_index": {
|
||
"description": "Index of the group type from the group mapping.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": [
|
||
"is_date_exact",
|
||
"is_date_before",
|
||
"is_date_after"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "group",
|
||
"default": "group",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Value must be a date in ISO 8601 format.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": [
|
||
"group_type_index",
|
||
"key",
|
||
"operator",
|
||
"value"
|
||
],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"group_type_index": {
|
||
"description": "Index of the group type from the group mapping.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"key": {
|
||
"description": "Use one of the properties the user has provided in the plan.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
|
||
"enum": ["is_set", "is_not_set"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "group",
|
||
"default": "group",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": [
|
||
"group_type_index",
|
||
"key",
|
||
"operator"
|
||
],
|
||
"type": "object"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"const": "id",
|
||
"default": "id",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"default": "in",
|
||
"enum": ["in", "not_in"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "cohort",
|
||
"default": "cohort",
|
||
"description": "Filter events by cohort membership. Use this to narrow down results to persons belonging to a specific cohort. Use `operator: \"in\"` to include cohort members, or `operator: \"not_in\"` to exclude them. Examples:\n- Include: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"in\" }`\n- Exclude: `{ type: \"cohort\", key: \"id\", value: 42, operator: \"not_in\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "The cohort ID to filter by.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
}
|
||
},
|
||
"required": ["value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"anyOf": [
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
|
||
"enum": [
|
||
"tag_name",
|
||
"text",
|
||
"href",
|
||
"selector"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`icontains` - case insensitive contains. `not_icontains` - case insensitive does not contain. `regex` - matches the regex pattern. `not_regex` - does not match the regex pattern.",
|
||
"enum": [
|
||
"exact",
|
||
"is_not",
|
||
"icontains",
|
||
"not_icontains",
|
||
"regex",
|
||
"not_regex"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "element",
|
||
"default": "element",
|
||
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. If the operator is `regex` or `not_regex`, the value must be a valid Datastore regex pattern to match against. Otherwise, the value must be a substring that will be matched against the property value. Use the string values `true` or `false` for boolean properties.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
|
||
"enum": [
|
||
"tag_name",
|
||
"text",
|
||
"href",
|
||
"selector"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": ["exact", "gt", "lt"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "element",
|
||
"default": "element",
|
||
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"type": "number"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
|
||
"enum": [
|
||
"tag_name",
|
||
"text",
|
||
"href",
|
||
"selector"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`exact` - exact match of any of the values. `is_not` - does not match any of the values.",
|
||
"enum": ["exact", "is_not"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "element",
|
||
"default": "element",
|
||
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Only use property values from the plan. Always use strings as values. If you have a number, convert it to a string first. If you have a boolean, convert it to a string \"true\" or \"false\".",
|
||
"items": {
|
||
"type": "string"
|
||
},
|
||
"type": "array"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
|
||
"enum": [
|
||
"tag_name",
|
||
"text",
|
||
"href",
|
||
"selector"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"enum": [
|
||
"is_date_exact",
|
||
"is_date_before",
|
||
"is_date_after"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "element",
|
||
"default": "element",
|
||
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"description": "Value must be a date in ISO 8601 format.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key", "operator", "value"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The element property to filter on. `tag_name` — HTML tag (e.g., `button`, `a`, `input`). `text` — visible text content of the element. `href` — the `href` attribute for links. `selector` — a CSS selector matching the element (e.g., `div.main > button.cta`).",
|
||
"enum": [
|
||
"tag_name",
|
||
"text",
|
||
"href",
|
||
"selector"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"description": "`is_set` - the property has any value. `is_not_set` - the property doesn't have a value or wasn't collected.",
|
||
"enum": ["is_set", "is_not_set"],
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "element",
|
||
"default": "element",
|
||
"description": "Filter by autocaptured HTML element properties (`$autocapture`, `$rageclick`). Example: `{ type: \"element\", key: \"text\", value: \"Sign Up\", operator: \"exact\" }`",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key", "operator"],
|
||
"type": "object"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "A InsightsQL boolean expression used as a filter condition.\n\nExamples:\n- Filter where a property exceeds a threshold: `toFloat(properties.load_time) > 5.0`\n- Filter with string matching: `properties.$current_url LIKE '%/pricing%'`\n- Filter with multiple conditions: `properties.$browser = 'Chrome' AND toFloat(properties.duration) > 30`",
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "insightsql",
|
||
"default": "insightsql",
|
||
"description": "Filter by a InsightsQL boolean expression for advanced filtering that can't be expressed with standard property filters.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["key"],
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"key": {
|
||
"description": "The feature flag key.",
|
||
"type": "string"
|
||
},
|
||
"operator": {
|
||
"const": "flag_evaluates_to",
|
||
"default": "flag_evaluates_to",
|
||
"type": "string"
|
||
},
|
||
"type": {
|
||
"const": "flag",
|
||
"default": "flag",
|
||
"description": "Filter events by feature flag state — only include events where a specific flag evaluated to a given value. Examples:\n- Flag enabled: `{ type: \"flag\", key: \"new-onboarding\", operator: \"flag_evaluates_to\", value: true }`\n- Specific variant: `{ type: \"flag\", key: \"checkout-experiment\", operator: \"flag_evaluates_to\", value: \"variant-a\" }`",
|
||
"type": "string"
|
||
},
|
||
"value": {
|
||
"anyOf": [
|
||
{
|
||
"type": "boolean"
|
||
},
|
||
{
|
||
"type": "string"
|
||
}
|
||
],
|
||
"description": "`true`/`false` for boolean flags, or a variant name string for multivariate flags."
|
||
}
|
||
},
|
||
"required": ["key", "value"],
|
||
"type": "object"
|
||
}
|
||
]
|
||
},
|
||
"type": "array"
|
||
},
|
||
"version": {
|
||
"description": "version of the node, used for schema migrations",
|
||
"type": "number"
|
||
}
|
||
},
|
||
"required": ["id", "name"],
|
||
"type": "object"
|
||
}
|
||
]
|
||
},
|
||
"minItems": 2,
|
||
"type": "array"
|
||
},
|
||
"operator": {
|
||
"const": "OR",
|
||
"default": "OR",
|
||
"description": "Only `OR` is supported.",
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["nodes"],
|
||
"type": "object"
|
||
}
|
||
]
|
||
},
|
||
"type": "array"
|
||
},
|
||
"trendsFilter": {
|
||
"description": "Properties specific to the trends insight",
|
||
"properties": {
|
||
"aggregationAxisFormat": {
|
||
"default": "numeric",
|
||
"description": "Formats the trends value axis. Do not use the formatting unless you are absolutely sure that formatting will match the data. `numeric` - no formatting. Prefer this option by default. `duration` - formats the value in seconds to a human-readable duration, e.g., `132` becomes `2 minutes 12 seconds`. Use this option only if you are sure that the values are in seconds. `duration_ms` - formats the value in miliseconds to a human-readable duration, e.g., `1050` becomes `1 second 50 milliseconds`. Use this option only if you are sure that the values are in miliseconds. `percentage` - appends a percentage sign to a value that is ALREADY on the 0-100 scale, e.g., `50` becomes `50%`. Only use this when the underlying value is already a percentage. `percentage_scaled` - multiplies a 0-1 value by 100 and appends a percentage sign, e.g., `0.5` becomes `50%`. Use this for ratios in the 0-1 range, such as a bounce rate (`avg($is_bounce)`) or a formula like `A/B`. Because this format already multiplies by 100, do NOT also multiply by 100 in the formula (e.g. `A/B*100`), as that would double-scale the value and render, say, `0.5` as `5000%`. `currency` - formats the value as a currency, e.g., `1000` becomes `$1,000`.",
|
||
"enum": [
|
||
"numeric",
|
||
"duration",
|
||
"duration_ms",
|
||
"duration_ns",
|
||
"percentage",
|
||
"percentage_scaled",
|
||
"currency",
|
||
"short"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"aggregationAxisPostfix": {
|
||
"description": "Custom postfix to add to the aggregation axis, e.g., ` clicks` to format 5 as `5 clicks`. You may need to add a space before postfix. Never set a postfix that `aggregationAxisFormat` already renders: `percentage` and `percentage_scaled` already append the `%` sign, so a `%` postfix would render values as `50%%`.",
|
||
"type": "string"
|
||
},
|
||
"aggregationAxisPrefix": {
|
||
"description": "Custom prefix to add to the aggregation axis, e.g., `$` for USD dollars. You may need to add a space after prefix.",
|
||
"type": "string"
|
||
},
|
||
"decimalPlaces": {
|
||
"description": "Number of decimal places to show. Do not add this unless you are sure that values will have a decimal point.",
|
||
"type": "number"
|
||
},
|
||
"display": {
|
||
"default": "ActionsLineGraph",
|
||
"description": "Visualization type. Available values: `ActionsLineGraph` - time-series line chart; most common option, as it shows change over time. `ActionsBar` - time-series bar chart. `ActionsAreaGraph` - time-series area chart. `ActionsLineGraphCumulative` - cumulative time-series line chart; good for cumulative metrics. `BoldNumber` - total value single large number. Use when user explicitly asks for a single output number. You CANNOT use this with breakdown or if the insight has more than one series. `Metric` - single large number with a period-over-period change pill and a sparkline. Like `BoldNumber` but trend-aware; configure it with the `metric*` fields below. Single series, no breakdown. `ActionsBarValue` - total value (NOT time-series) bar chart; good for categorical data. `ActionsPie` - total value pie chart; good for visualizing proportions. `ActionsTable` - total value table; good when using breakdown to list users or other entities. `WorldMap` - total value world map; use when breaking down by country name using property `$geoip_country_name`, and only then.",
|
||
"enum": [
|
||
"Auto",
|
||
"ActionsLineGraph",
|
||
"ActionsBar",
|
||
"ActionsUnstackedBar",
|
||
"ActionsAreaGraph",
|
||
"ActionsLineGraphCumulative",
|
||
"BoldNumber",
|
||
"Metric",
|
||
"ActionsPie",
|
||
"ActionsBarValue",
|
||
"ActionsTable",
|
||
"WorldMap",
|
||
"CalendarHeatmap",
|
||
"TwoDimensionalHeatmap",
|
||
"BoxPlot",
|
||
"SlopeGraph"
|
||
],
|
||
"type": "string"
|
||
},
|
||
"formulaNodes": {
|
||
"description": "Use custom formulas to perform mathematical operations like calculating percentages or metrics. Use the following syntax: `A/B`, where `A` and `B` are the names of the series. You can combine math aggregations and formulas. When using a formula, you must:\n- Identify and specify **all** events and actions needed to solve the formula.\n- Carefully review the list of available events and actions to find appropriate entities for each part of the formula.\n- Ensure that you find events and actions corresponding to both the numerator and denominator in ratio calculations. Examples of using math formulas:\n- If you want to calculate the percentage of users who have completed onboarding, you need to find and use events or actions similar to `$identify` and `onboarding complete`, so the formula will be `A / B`, where `A` is `onboarding complete` (unique users) and `B` is `$identify` (unique users). For a ratio or percentage, keep the formula as the raw ratio (e.g. `A/B`, which is in the 0-1 range) and set `aggregationAxisFormat` to `percentage_scaled` so it renders as a percentage. Do NOT multiply the formula by 100 (e.g. `A/B*100`) when using `percentage_scaled`, or the value will be scaled twice.",
|
||
"items": {
|
||
"properties": {
|
||
"custom_name": {
|
||
"description": "Optional user-defined name for the formula",
|
||
"type": "string"
|
||
},
|
||
"formula": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
"required": ["formula"],
|
||
"type": "object"
|
||
},
|
||
"type": "array"
|
||
},
|
||
"metricChangeDecreaseColor": {
|
||
"description": "Only applies when `display` is `Metric`. Hex color (e.g. `#db3707`) for the change pill when the metric went DOWN. Defaults to red (`#db3707`). For a \"lower is better\" metric (latency, error rate, cost), set this to a green (e.g. `#388600`) so a decrease reads as good.",
|
||
"type": "string"
|
||
},
|
||
"metricChangeIncreaseColor": {
|
||
"description": "Only applies when `display` is `Metric`. Hex color (e.g. `#388600`) for the change pill when the metric went UP. Defaults to green (`#388600`). For a \"lower is better\" metric (latency, error rate, cost), set this to a red (e.g. `#db3707`) so an increase reads as bad.",
|
||
"type": "string"
|
||
},
|
||
"metricColorByDirection": {
|
||
"default": false,
|
||
"description": "Only applies when `display` is `Metric`. Color the sparkline under the big number by whether the metric increased or decreased over the period (using the increase/decrease line colors).",
|
||
"type": "boolean"
|
||
},
|
||
"metricLineDecreaseColor": {
|
||
"description": "Only applies when `display` is `Metric` and `metricColorByDirection` is `true`. Hex color for the sparkline when the metric went DOWN. Defaults to red (`#db3707`). Flip to a green for a \"lower is better\" metric.",
|
||
"type": "string"
|
||
},
|
||
"metricLineIncreaseColor": {
|
||
"description": "Only applies when `display` is `Metric` and `metricColorByDirection` is `true`. Hex color for the sparkline when the metric went UP. Defaults to green (`#388600`). Flip to a red for a \"lower is better\" metric.",
|
||
"type": "string"
|
||
},
|
||
"metricShowChange": {
|
||
"default": true,
|
||
"description": "Only applies when `display` is `Metric`. Show the change pill next to the big number. What it compares follows `metricSummary`: `total`/`average` compare against the previous period when \"compare to previous\" is on (otherwise first→last of the series), and `latest` is always first→last of the series.",
|
||
"type": "boolean"
|
||
},
|
||
"metricSummary": {
|
||
"default": "total",
|
||
"description": "Only applies when `display` is `Metric`. Which summary the resting big number shows: `total` (sum over the period), `average` (mean of the points), or `latest` (last point). Hovering the sparkline always shows the hovered point's value regardless of this setting. Also drives the change pill: `total`/`average` compare against the previous period when \"compare to previous\" is on; `latest` compares first→last of the series.",
|
||
"enum": ["total", "average", "latest"],
|
||
"type": "string"
|
||
},
|
||
"showAlertThresholdLines": {
|
||
"default": false,
|
||
"description": "Whether to show alert threshold lines on the chart.",
|
||
"type": "boolean"
|
||
},
|
||
"showLabelsOnSeries": {
|
||
"default": false,
|
||
"description": "Whether to show labels on each series.",
|
||
"type": "boolean"
|
||
},
|
||
"showLegend": {
|
||
"default": false,
|
||
"description": "Whether to show the legend describing series and breakdowns.",
|
||
"type": "boolean"
|
||
},
|
||
"showMultipleYAxes": {
|
||
"default": false,
|
||
"description": "Whether to show multiple y-axes for different series.",
|
||
"type": "boolean"
|
||
},
|
||
"showPercentStackView": {
|
||
"default": false,
|
||
"description": "Whether to show a percentage of each series. Use only with",
|
||
"type": "boolean"
|
||
},
|
||
"showValuesOnSeries": {
|
||
"default": false,
|
||
"description": "Whether to show a value on each data point.",
|
||
"type": "boolean"
|
||
},
|
||
"smoothingIntervals": {
|
||
"default": 1,
|
||
"description": "Smoothing intervals for the trend line.",
|
||
"maximum": 9007199254740991,
|
||
"minimum": -9007199254740991,
|
||
"type": "integer"
|
||
},
|
||
"xAxisLabel": {
|
||
"description": "Custom label rendered under the X axis.",
|
||
"type": "string"
|
||
},
|
||
"yAxisLabel": {
|
||
"description": "Custom label rendered alongside the Y axis.",
|
||
"type": "string"
|
||
},
|
||
"yAxisScaleType": {
|
||
"default": "linear",
|
||
"description": "Whether to scale the y-axis.",
|
||
"enum": ["log10", "linear"],
|
||
"type": "string"
|
||
}
|
||
},
|
||
"type": "object"
|
||
}
|
||
},
|
||
"required": ["series"],
|
||
"type": "object"
|
||
}
|