Source: https://datafa.st/docs/cli-funnels
Markdown source: https://datafa.st/docs/cli-funnels.md
Description: Create, update, delete, and list conversion funnels using the DataFast CLI.

# CLI — Funnels

Manage conversion funnels. Requires a `dft_` admin token.

Run `datafast funnels` to choose a command interactively. Commands prompt for the website or funnel when omitted, and every picker includes `Cancel`. You can also press `Ctrl+C` to exit.

## List funnels

```sh
datafast funnels
datafast funnels list
datafast funnels list <websiteId>
```

## Create a funnel

Run without `--steps` for an interactive step builder (minimum 2 steps, maximum 8):

```sh
datafast funnels create <websiteId>
```

Or pass steps as JSON to skip the prompts. Each step has a `name`, `type` (`pageview` or `goal`), and either a `url` (for pageview steps) or a `goalName` (for goal steps):

```sh
datafast funnels create <websiteId> --name "Checkout" --steps '[
  {"name":"Visit pricing","type":"pageview","url":"/pricing"},
  {"name":"Start checkout","type":"pageview","url":"/checkout"},
  {"name":"Purchase","type":"goal","goalName":"purchase"}
]'
```

## Update a funnel

```sh
# Rename
datafast funnels update <websiteId> <funnelId> --name "New name"

# Enable / disable
datafast funnels update <websiteId> <funnelId> --enable
datafast funnels update <websiteId> <funnelId> --disable
```

## Delete a funnel

```sh
datafast funnels delete <websiteId> <funnelId>

# Skip the confirmation prompt
datafast funnels delete <websiteId> <funnelId> --yes
```
