Create a funnel
create_funnelSave a funnel of 2 to 10 ordered steps. Its steps and trait_scope are final (update_funnel changes only its name and goal settings), and it counts visitors only from the day it is created: there is no history to fill in. So check every step with preview_funnel first, and create the funnels that matter early. A step on a data-track name that is not deployed yet matches nothing until the code ships: expected, not broken; tell the user. Uses a funnels slot (get_project slots_left). is_goal makes it a goal in the same call, with an optional goal_value (see update_funnel). Pass run_id from start_setup_run so this undoes together with the rest of the setup; leave it out (never "") to start a new chat run, whose run_id is returned and should go on every later change.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>",
"steps": "<steps>"
},
"name": "create_funnel"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Funnel name, at most 100 characters (also the goal's name when is_goal). | |
| steps | Yes | 2 to 10 steps in order. Each step's filters is an object with any of event_type (pageview, click, form_submit, custom), page_origin, page_path (exact, as stored, e.g. /products/:id) and feature (a data-track name or feature rule name; met by any event that feature counts, so a feature rule with starts_with or matches on page_path makes one step out of many pages). All must match, exactly and case-sensitively. Final once created. | |
| run_id | No | The setup run this change belongs to, from start_setup_run. Omit to start a new chat run (its id is returned). | |
| is_goal | No | true makes the funnel a goal in the same call: its conversions (visitor-days reaching the last step that day) show per source and campaign. At most 5 goals per project; a goal is still one of the plan's funnels. | |
| project | No | Project ID, from list_projects. Required when this connection covers more than one project; may be left out when it covers one (and with an API key, which belongs to one project). | |
| goal_value | No | What one conversion is worth, in the project's currency (get_project). Omit for no value. | |
| trait_scope | No | How the funnel counts when it is read for one trait (get_funnel's trait). visitor (the default): a visitor whose events carried the trait anywhere that day counts under it at every step, also on pages that do not send it. Right for A/B tests (only the tested page sends variant-b, the purchase on the thank-you page still counts for variant B) and for traits that describe the visitor. step: a step counts under the trait only when the event that met that step carried it, for a trait that describes the moment (an upgrade funnel read for plan-free, whose last page sends plan-pro). Final once created, like the steps. Leave it out unless the user wants step. |