Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,111 @@

See [Global settings](/organize/settings) for more information about `docs.json`.

### View analytics

View analytics data for your documentation site directly from the command line. You must be authenticated with `mint login` before using analytics commands.

Check warning on line 347 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L347

In general, use active voice instead of passive voice ('be authenticated').

```bash
mint analytics <subcommand>
```

The `analytics` command has the following subcommands:

Check warning on line 353 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L353

Did you really mean 'subcommands'?

| Subcommand | Description |

Check warning on line 355 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L355

Did you really mean 'Subcommand'?
| --- | --- |
| `stats` | Display KPI numbers including views, visitors, searches, and feedback. |

Check warning on line 357 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L357

Spell out 'KPI', if it's unfamiliar to the audience.
| `search` | Display search query analytics with hit counts and click-through rates. |
| `feedback` | Display user feedback on documentation pages. |
| `conversation list` | List assistant conversations. |
| `conversation view <id>` | View a single assistant conversation by ID. |
| `conversation buckets list` | List conversation category buckets. |
| `conversation buckets view <id>` | View conversations in a specific bucket. |

All analytics subcommands accept the following flags:

Check warning on line 365 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L365

Did you really mean 'subcommands'?

| Flag | Description | Default |
| --- | --- | --- |
| `--subdomain` | Documentation subdomain. | Value from `mint config get subdomain`, or auto-detected. |
| `--from` | Start date in `YYYY-MM-DD` format. | 7 days ago, or value from `mint config get dateFrom`. |
| `--to` | End date in `YYYY-MM-DD` format. | Today, or value from `mint config get dateTo`. |
| `--format` | Output format: `table` (pretty), `plain` (pipeable, default), `json` (raw API response), or `graph` (bar charts). | `plain` |
| `--agent` | Agent-friendly output, equivalent to `--format json`. Also activates automatically when the `CLAUDECODE` environment variable is set to `1`. | `false` |

Check warning on line 373 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L373

In general, use active voice instead of passive voice ('is set').

Some subcommands accept additional flags:

Check warning on line 375 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L375

Did you really mean 'subcommands'?

| Subcommand | Flag | Description |

Check warning on line 377 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L377

Did you really mean 'Subcommand'?
| --- | --- | --- |
| `stats` | `--agents` | Show only agent traffic. |
| `stats` | `--humans` | Show only human traffic. |
| `stats` | `--page` | Filter to a specific page path. |
| `search` | `--query` | Filter by search query substring. |

Check warning on line 382 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L382

Did you really mean 'substring'?
| `search` | `--page` | Filter by top clicked page. |
| `feedback` | `--type` | Feedback type: `code` (code snippets) or `page` (page-level aggregation). |
| `feedback` | `--page` | Filter to a specific page path. |
| `conversation list` | `--page` | Filter conversations mentioning this page in sources. |

For example, to view a summary of your documentation analytics for the last 30 days:

```bash
mint analytics stats --from 2025-03-01 --to 2025-03-31
```

To see what your users are searching for:

```bash
mint analytics search --format table
```

To export analytics data as JSON for further processing:

```bash
mint analytics stats --format json
```

<Tip>
Use `--format json` or `--agent` to get machine-readable output that you can pipe into other tools like `jq`.
</Tip>

### Manage CLI configuration

Set default values for CLI commands using `mint config`. Configuration is stored in `~/.mintlify/config.json`.

Check warning on line 412 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L412

In general, use active voice instead of passive voice ('is stored').

```bash
mint config <subcommand>
```

| Subcommand | Description |

Check warning on line 418 in installation.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

installation.mdx#L418

Did you really mean 'Subcommand'?
| --- | --- |
| `set <key> <value>` | Set a configuration value. |
| `get <key>` | Get a configuration value. |
| `clear <key>` | Remove a configuration value. |

The following configuration keys are available:

| Key | Description | Used by |
| --- | --- | --- |
| `subdomain` | Default documentation subdomain. | `mint analytics` |
| `dateFrom` | Default start date for analytics queries (`YYYY-MM-DD`). | `mint analytics` |
| `dateTo` | Default end date for analytics queries (`YYYY-MM-DD`). | `mint analytics` |

For example, to set a default subdomain so you don't need to pass `--subdomain` on every analytics command:

```bash
mint config set subdomain my-docs
```

To check the current value:

```bash
mint config get subdomain
```

To remove a saved value:

```bash
mint config clear subdomain
```

### Check version

Display the current CLI and client version:
Expand Down
4 changes: 4 additions & 0 deletions optimize/analytics.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

The [analytics](https://dashboard.mintlify.com/products/analytics/v2/) page in your dashboard shows data about visitors to your docs, how they interact with the assistant, what they search for, and their feedback. Use this information to identify which pages are most valuable to your users and track trends over time.

<Tip>
You can also access analytics data from the command line using `mint analytics`. See the [CLI reference](/installation#view-analytics) for details.
</Tip>

## Filter by AI or human visitors

Filter your analytics data by traffic source to analyze AI agent traffic separately from human visitors.
Expand Down Expand Up @@ -83,7 +87,7 @@

### Categories

The categories tab uses LLMs to automatically group conversations by topic or theme.

Check warning on line 90 in optimize/analytics.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

optimize/analytics.mdx#L90

Did you really mean 'LLMs'?

<Frame>
<img
Expand Down
Loading