# 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 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 ## 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 the CLI if the task is about the user's own DataFast account or analytics. 2. Use `datafast --json ...` when you need structured output for analysis. 3. Use the `.md` documentation pages when reading docs programmatically. 4. Do not delete websites, tokens, goals, payments, funnels, alerts, or team members unless the user explicitly asks. 5. Do not expose API tokens, site keys, or local config contents in chat. 6. 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