Files
mintlify[bot] d6960c72bf Improve SEO metadata across documentation pages (#5310)
* Improve SEO metadata: fix titles, descriptions, and remove redundant OpenAPI descriptions

- Remove description frontmatter from 19 API pages where the OpenAPI spec already supplies the description
- Fix 2 titles that exceeded 60 characters (content-templates, content-types)
- Improve 15 descriptions that were too short (<130 chars) or too long (>160 chars) to target 130-155 characters
- All descriptions are unique and include relevant search terms

Generated-By: mintlify-agent

* re-add API descriptions

* Apply suggestion from @ethanpalm

* Apply suggestion from @ethanpalm

* Apply suggestion from @ethanpalm

* Apply suggestion from @ethanpalm

---------

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
Co-authored-by: Ethan Palm <56270045+ethanpalm@users.noreply.github.com>
2026-04-13 09:41:41 -07:00

131 lines
4.0 KiB
Plaintext

---
title: "Analyze your documentation"
description: "Use the mint analytics command to view traffic, search queries, user feedback, and AI assistant conversations directly from your terminal."
keywords: ["mint analytics", "analytics", "CLI", "stats", "feedback", "conversations"]
---
The `mint analytics` command gives you access to your [documentation analytics](/optimize/analytics) from the terminal. This is useful for scripting analytics reports, piping data into other tools, and quick checks without opening the dashboard.
## Prerequisites
You must log in to use analytics commands. Run `mint login` to authenticate with your Mintlify account.
See [Preview locally](/cli/preview#log-in-for-search-and-assistant) for details on authentication.
## View key metrics
Display a summary of views, visitors, searches, feedback, and assistant usage:
```bash
mint analytics stats
```
Use flags to filter by date range or page:
- `--from`: Start date in `YYYY-MM-DD` format. Defaults to 7 days ago.
- `--to`: End date in `YYYY-MM-DD` format. Defaults to today.
- `--page`: Filter to a specific page path.
```bash Example analytics stats flags
mint analytics stats --from 2025-01-01 --to 2025-01-31
mint analytics stats --page /quickstart
```
## View search analytics
See what your users are searching for, with hit counts and click-through rates:
```bash
mint analytics search
```
Use flags to filter by query string or page:
- `--query`: Filter by search query substring.
- `--page`: Filter to a specific page path.
```bash Example analytics search flags
mint analytics search --query "authentication"
mint analytics search --page /api-reference
```
## View feedback
Review feedback submitted by users on your documentation pages:
```bash
mint analytics feedback
```
Use flags to aggregate feedback by page, or filter to code snippet feedback:
- `--type`: Aggregate feedback by page or code snippet. Defaults to page.
- `--page`: Filter to a specific page path.
```bash Example analytics feedback flags
mint analytics feedback --type page
mint analytics feedback --type code
```
## View assistant conversations
List recent conversations and conversation category buckets from the AI assistant:
```bash
mint analytics conversation list
mint analytics conversation buckets list
```
Each list output includes an ID for each entry. Pass that ID to the corresponding `view` command to see full details:
```bash
mint analytics conversation view <conversation-id>
mint analytics conversation buckets view <bucket-id>
```
## Choose an output format
All analytics commands default to `plain` output, which is tab-separated and suitable for piping to other tools. Use `--format` to change the output:
```bash
mint analytics stats --format table # Pretty-printed table with colors
mint analytics stats --format json # Raw JSON
mint analytics stats --format graph # Horizontal bar chart
```
The CLI automatically detects AI agent environments like Claude Code or non-interactive terminals and defaults to JSON output.
## Set defaults with config
To avoid repeating common flags, set defaults with `mint config`. The configuration saves in `~/.config/mintlify/config.json`.
When you run `mint login`, the CLI sets the `subdomain` key. If you have multiple deployments, the CLI prompts you to choose one. You can override the default at any time with `mint config set subdomain <subdomain>`.
Available configuration keys:
| Key | Description |
| --- | --- |
| `subdomain` | Default subdomain for analytics commands. Set by the `mint login` command. |
| `dateFrom` | Default start date for analytics queries (`YYYY-MM-DD`). |
| `dateTo` | Default end date for analytics queries (`YYYY-MM-DD`). |
```bash Example configs
mint config set subdomain my-docs
mint config set dateFrom 2025-01-01
```
Once set, analytics commands use these values automatically:
```bash
# Uses the configured subdomain and dateFrom without flags
mint analytics stats
```
To view or clear a value, run:
```bash
mint config get subdomain
mint config clear subdomain
```