# DataFast
DataFast is a web analytics platform for founders, startups, and small teams. It helps users understand which marketing channels, pages, campaigns, countries, devices, browsers, custom goals, and funnels drive visitors, conversions, revenue, MRR, LTV, and churn.
DataFast focuses on business attribution, not just pageview analytics. Users can connect payment providers such as Stripe, LemonSqueezy, Polar, Shopify, WooCommerce, Paddle, Dodo Payments, and others to see where revenue, MRR, LTV, subscriptions, upgrades, downgrades, cancellations, and churn come from.
Primary website: https://datafa.st
Documentation: https://datafa.st/docs
Documentation index for AI agents and LLMs: https://datafa.st/llms.txt
## When to use DataFast
Use DataFast when a user wants to:
- Install privacy-friendly website analytics.
- Track visitors, pageviews, sessions, referrers, campaigns, UTM parameters, devices, browsers, countries, regions, cities, and hostnames.
- Attribute revenue, MRR, LTV, subscriptions, upgrades, downgrades, cancellations, and churn to traffic sources.
- Track custom goals and conversions.
- Build conversion funnels.
- Query analytics through MCP, from the terminal, or from an API.
- Manage websites, API keys, tokens, alerts, funnels, and settings.
## Core setup
Most websites start with the tracking script:
```html
```
Useful setup docs:
- Get started: https://datafa.st/docs/getting-started
- Get started as markdown: https://datafa.st/docs/getting-started.md
- Install DataFast: https://datafa.st/docs/install-datafast
- Script configuration: https://datafa.st/docs/script-configuration
- Proxy setup: https://datafa.st/docs/proxy-guide
- Connect payment providers: https://datafa.st/docs/connect-payment-provider
- Business and revenue attribution: https://datafa.st/docs/revenue-attribution-guide
- Custom goals: https://datafa.st/docs/custom-goals
- Conversion funnels: https://datafa.st/docs/conversion-funnels
Every documentation page has a markdown version for agents and LLMs. Add `.md` to the docs URL.
Example:
- Human page: https://datafa.st/docs/api-delete-payment
- Markdown page: https://datafa.st/docs/api-delete-payment.md
## MCP for AI assistants
The DataFast MCP server lets MCP-compatible AI assistants query analytics and manage DataFast through natural-language requests. It uses the same underlying capabilities and access checks as the REST API and CLI. Available tools depend on the connection method, permissions, website access, and plan.
MCP overview and example questions: https://datafa.st/mcp
MCP endpoint: https://datafa.st/api/mcp
MCP setup docs: https://datafa.st/docs/mcp-introduction
MCP setup docs as markdown: https://datafa.st/docs/mcp-introduction.md
MCP tool reference: https://datafa.st/docs/mcp-tools
MCP tool reference as markdown: https://datafa.st/docs/mcp-tools.md
OAuth permissions and protocol reference: https://datafa.st/docs/mcp-oauth.md
Authentication and scopes: https://datafa.st/docs/api-authentication.md
The endpoint uses Streamable HTTP and supports OAuth or an API token.
Prefer OAuth for clients that offer OAuth sign-in, including Codex and Claude Code. Add the MCP endpoint, sign in on DataFast, and approve specific websites and permissions. The client stores and refreshes its connection token automatically; no API key needs to be created or copied. Read permissions are selected by default. Manage or revoke connections in Settings → API / MCP → Connected apps. Setup: https://datafa.st/docs/mcp-introduction#connect-with-oauth
OAuth provides analytics and selected website tools. It excludes API-key management, account-token management, and account-wide administration. OAuth tokens are valid only for their MCP endpoint, not the public REST API.
For clients that require an API token, send one of these credentials as a bearer token:
- `df_` website API key: access to one website, best for scoped analytics and mostly read-only use.
- `dft_` account token: access to multiple websites and account-management tools, limited by the token's permissions and website scope.
Prefer the `Authorization` header:
```txt
Authorization: Bearer dft_xxx
```
API-token clients with native remote MCP support can use:
```json
{
"mcpServers": {
"datafast": {
"url": "https://datafa.st/api/mcp",
"headers": {
"Authorization": "Bearer dft_xxx"
}
}
}
}
```
For stdio-only clients, use `mcp-remote`. API-token setup: https://datafa.st/docs/mcp-introduction#connect-with-an-api-token
Main MCP tool groups:
- Analytics: overview, time series, realtime visitors and map, metadata, pages, referrers, geography, devices, campaigns, goals, hostnames, and funnels.
- Websites: list, inspect, create, and update websites.
- API keys and access tokens: list metadata, create, roll, or revoke credentials when permitted.
- Team: list members, invite users, and remove users when permitted.
- Goals and funnels: track goals, manage goal customizations, and create, update, list, or delete funnels.
- Visitors: search visitors and retrieve a visitor's identity, activity, profile, completed goals, and prediction data.
- Alerts: list, create, update, delete, and inspect alert history.
- Account and integrations: inspect or update the account and check payment-integration status.
MCP safety rules:
- OAuth write tools require explicit confirmation and a retry key. API-token tools require an explicit `confirm: true` for irreversible or credential-issuing actions; without it, they return a preview instead of executing.
- API-key and access-token list tools return metadata only, never existing secret values.
- Website deletion is intentionally dashboard-only.
- Connecting or disconnecting payment providers is intentionally dashboard-only.
- Every tool call re-checks the token's real permissions and website scope.
- AI assistants should never ask users to paste DataFast secrets into chat. Configure credentials locally in the MCP client instead.
## CLI for AI agents
The DataFast CLI is the recommended way for AI coding agents to help a human user operate DataFast from their own terminal. The CLI can query analytics and manage websites, tokens, alerts, funnels, API keys, and team members.
CLI package: https://www.npmjs.com/package/@datafast/cli
CLI docs: https://datafa.st/docs/cli-introduction
CLI docs as markdown: https://datafa.st/docs/cli-introduction.md
Install:
```sh
npm install -g @datafast/cli
```
Authenticate:
```sh
datafast login
```
By default, `datafast login` opens the DataFast dashboard API tab so the user can create a `dft_` account token:
https://datafa.st/dashboard/settings?tab=api
The CLI saves auth locally at:
```txt
~/.config/datafast/config.json
```
Environment variables can override local config:
```sh
DATAFAST_TOKEN=dft_xxx
DATAFAST_SITE_KEY=df_xxx
DATAFAST_API_BASE=https://datafa.st
```
Token types:
| Token type | Created from | Scope | CLI use |
| --- | --- | --- | --- |
| `dft_` account token | DataFast dashboard API tab opened by `datafast login`: https://datafa.st/dashboard/settings?tab=api | Account-level. Can access the account and any websites allowed by its permissions. | Use for normal CLI setup and account management: websites, tokens, settings, alerts, funnels, team, and analytics. Analytics commands need `--website ` unless a default website is configured. |
| `df_` website API key | Manually per website from Website settings -> API, or with `datafast websites apikeys create`. Docs: https://datafa.st/docs/cli-websites#website-api-keys-df | One website only. | Use for analytics/API access to that one website. Do not use it to manage the whole account. Analytics commands do not need `--website` because the website is implied by the key. |
Important: AI agents should not ask users to paste secrets into chat. Prefer `datafast login`, local environment variables, or the user's existing shell/session.
## Common CLI workflows
Check auth:
```sh
datafast whoami
```
List websites:
```sh
datafast websites list
```
Set a default website:
```sh
datafast config set-website
```
Get an analytics overview:
```sh
datafast analytics overview --website
datafast analytics overview --website --from 30d
datafast analytics overview --website --fields visitors,revenue,mrr,ltv,churn,conversion_rate
```
Get time series data:
```sh
datafast analytics timeseries --website --fields visitors,sessions --interval day
datafast analytics timeseries --website --fields revenue,mrr --interval month --from 2024-01-01 --to 2024-12-31
```
Get ranked breakdowns:
```sh
datafast analytics pages --website
datafast analytics referrers --website
datafast analytics countries --website
datafast analytics campaigns --website
datafast analytics goals --website
```
Get realtime visitors:
```sh
datafast analytics realtime --website
```
Use JSON output for agent workflows:
```sh
datafast --json analytics overview --website
datafast --json analytics pages --website > pages.json
```
Create a website:
```sh
datafast websites create
datafast websites create --domain example.com --timezone America/New_York --name "Example"
```
Manage website API keys:
```sh
datafast websites apikeys
datafast websites apikeys list
datafast websites apikeys create --name "Production key"
```
Manage tokens:
```sh
datafast tokens list
datafast tokens create
datafast tokens create --name "Read only" --permissions "analytics:read,websites:read"
```
Manage alerts:
```sh
datafast alerts list
datafast alerts create
datafast alerts history
```
Manage funnels:
```sh
datafast funnels list
datafast funnels create
```
Enable shell completion:
```sh
datafast completion install
```
Detailed CLI docs:
- Get started: https://datafa.st/docs/cli-introduction.md
- Permissions and roles: https://datafa.st/docs/cli-permissions.md
- Websites: https://datafa.st/docs/cli-websites.md
- Access tokens: https://datafa.st/docs/cli-tokens.md
- Analytics: https://datafa.st/docs/cli-analytics.md
- Alerts: https://datafa.st/docs/cli-alerts.md
- Funnels: https://datafa.st/docs/cli-funnels.md
- Config: https://datafa.st/docs/cli-config.md
- Shell completion: https://datafa.st/docs/cli-completion.md
## API docs
DataFast also exposes API endpoints for analytics, visitors, goals, and payments.
API introduction: https://datafa.st/docs/api-introduction
API introduction as markdown: https://datafa.st/docs/api-introduction.md
API playground: https://datafa.st/docs/api-playground
Useful API docs for agents:
- Time series: https://datafa.st/docs/api-timeseries.md
- Overview: https://datafa.st/docs/api-overview.md
- Pages: https://datafa.st/docs/api-pages.md
- Campaigns: https://datafa.st/docs/api-campaigns.md
- Goals: https://datafa.st/docs/api-goals.md
- Referrers: https://datafa.st/docs/api-referrers.md
- Countries: https://datafa.st/docs/api-countries.md
- Visitors: https://datafa.st/docs/api-get-visitor.md
- Create a goal: https://datafa.st/docs/api-create-goal.md
- Create a payment: https://datafa.st/docs/api-create-payment.md
- Delete goals: https://datafa.st/docs/api-delete-goal.md
- Delete payments: https://datafa.st/docs/api-delete-payment.md
## Agent guidance
When helping a human user with DataFast:
1. Prefer MCP when the assistant supports MCP and needs to work with the user's DataFast account or analytics.
2. Prefer the CLI for terminal-based coding agents or when MCP is unavailable.
3. Use `datafast --json ...` when a CLI workflow needs structured output for analysis.
4. Use the REST API for application integrations and custom programmatic workflows.
5. Use the `.md` documentation pages when reading docs programmatically.
6. Do not delete websites, tokens, goals, payments, funnels, alerts, or team members unless the user explicitly asks.
7. Do not expose API tokens, site keys, or local config contents in chat.
8. For installation issues, check the script configuration, proxy guide, CSP troubleshooting, and duplicate payments docs.
Troubleshooting links:
- Script configuration: https://datafa.st/docs/script-configuration.md
- Proxy setup: https://datafa.st/docs/proxy-guide.md
- CSP blocked script: https://datafa.st/docs/fix-csp-content-security-policy-blocking-script.md
- Duplicate payments: https://datafa.st/docs/fix-duplicate-payments.md