### Monthly Churn Calculation Example
Source: https://statable.com/docs/behavior/churn-rate
Worked example for a SaaS platform with 1000 subscribers at month start, 80 cancellations, and 150 new subscribers, resulting in an 8% monthly churn rate.
```text
Monthly Customer Churn = (80 / 1000) × 100% = 8%
```
--------------------------------
### Install statable CLI and sign in
Source: https://statable.com/docs/integrations/omarchy
Install the statable CLI using go install, then authenticate with a read-only key and set the default site. The CLI reads the key from the system keyring, so the widgets never see it.
```bash
go install github.com/key-arg/statable-cli/cmd/statable@latest
statable auth login # a key with Read analytics is enough
statable sites use example.com
```
--------------------------------
### statable funnels create examples
Source: https://statable.com/docs/cli/commands
Examples of creating funnels with steps.
```bash
statable funnels create --name Signup --step page:/pricing --step event:Signup
```
```bash
statable funnels create --name Checkout --step entry:/shop --step goal:9 --strict-order
```
--------------------------------
### Framework Examples
Source: https://statable.com/docs/developers/javascript-api
Usage examples for React, Vue, and plain DOM event handlers.
```APIDOC
## Framework Examples
### React
```javascript
import { useEffect } from 'react';
function PricingPage() {
useEffect(() => {
window.statable.t('Pricing Viewed');
}, []);
const handleUpgrade = (plan) => {
window.statable.t('Upgrade Clicked', { plan });
};
return ;
}
```
### Vue
```javascript
```
### Plain DOM
```html
```
```
--------------------------------
### statable settings tracking example
Source: https://statable.com/docs/cli/commands
Example showing how to read the current tracking feature list before replacing it.
```bash
statable settings tracking
```
--------------------------------
### statable goals create examples
Source: https://statable.com/docs/cli/commands
Examples of creating goals for events, paths, and scroll depth.
```bash
statable goals create --name Signup --event Signup
statable goals create --name Pricing --path /pricing
statable goals create --name Blog --path /blog --operator begins
statable goals create --name 'Read to end' --scroll 90
```
--------------------------------
### GET /sites/{id}
Source: https://statable.com/docs/developers/stats-api/overview
Fetches a site and its install snippet.
```APIDOC
## GET /sites/{id}
### Description
Fetches a site and its install snippet.
### Method
GET
### Endpoint
/sites/{id}
### Parameters
#### Path Parameters
- **id** (string) - Required - The site ID.
### Response
#### Success Response (200)
- **site** (object) - Site details and install snippet.
#### Response Example
{
"site": {}
}
```
--------------------------------
### statable goals examples
Source: https://statable.com/docs/cli/commands
Examples of listing goals and filtering with jq.
```bash
statable goals
statable goals --json | jq -r '.[] | select(.kind == "event") | .target'
```
--------------------------------
### statable keys events example
Source: https://statable.com/docs/cli/commands
Example of viewing the lifecycle trail of a key.
```bash
statable keys events 42
```
--------------------------------
### Install via Go install
Source: https://statable.com/docs/cli
Installs the Statable CLI using the Go toolchain from the official module path. Useful for Arch and Omarchy users until an Arch package is available.
```bash
go install github.com/key-arg/statable-cli/cmd/statable@latest
```
--------------------------------
### statable props examples
Source: https://statable.com/docs/cli/commands
Examples of listing custom properties and using them in a top query with a filter.
```bash
statable props
statable props --range 7d
statable top event:props:plan --filter 'event=Signup'
```
--------------------------------
### statable funnels examples
Source: https://statable.com/docs/cli/commands
Examples of listing funnels and outputting JSON for piping to jq.
```bash
statable funnels
```
```bash
statable funnels --json | jq '.[].id'
```
--------------------------------
### statable settings set tracking examples
Source: https://statable.com/docs/cli/commands
Example of setting tracking features. This enables the 'outbound' and 'scroll' features.
```bash
statable settings set tracking --feature outbound --feature scroll
```
--------------------------------
### Stickiness Calculation Example
Source: https://statable.com/docs/behavior/stickiness
Example calculation with 15,000 DAU and 60,000 MAU yielding 25% stickiness.
```text
Stickiness = (15,000 / 60,000) × 100% = 25%
```
--------------------------------
### statable query examples
Source: https://statable.com/docs/cli/commands
Examples of using 'statable query' with various metrics, dimensions, filters, and limits.
```bash
statable query --metric visitors,pageviews --range 7d
statable query --metric visitors --dimension time:day --filter country=US
statable query --metric visitors --dimension visit:utm_campaign --limit 25
statable query --metric visitors --dimension event:props:plan --filter event=Signup
```
--------------------------------
### statable sites edit examples
Source: https://statable.com/docs/cli/commands
Examples of editing a site: changing timezone, week start, and url.
```bash
statable sites edit --timezone Europe/Kyiv
```
```bash
statable sites edit --week-start monday
```
```bash
statable sites edit --site example.com --url https://www.example.com
```
--------------------------------
### statable sites create examples
Source: https://statable.com/docs/cli/commands
Examples of creating a site with various options: default, with timezone, and with JSON output piped to jq to extract the snippet.
```bash
statable sites create https://example.com
```
```bash
statable sites create https://example.com --timezone Europe/Kyiv
```
```bash
statable sites create https://example.com --json | jq -r .snippet
```
--------------------------------
### Get install snippet endpoint
Source: https://statable.com/docs/developers/stats-api/sites
Sends a GET request to retrieve the install snippet. Requires only Read analytics permission. The ?type parameter returns widget bundles instead of the tracker; unknown types return 400.
```http
GET /api/v1/sites/{id}/snippet
```
--------------------------------
### GET /api/v1/sites/{id}/snippet
Source: https://statable.com/docs/developers/stats-api/sites
Retrieves the installation snippet or a widget bundle for a site.
```APIDOC
## GET /api/v1/sites/{id}/snippet
### Description
Retrieves the installation snippet for a site. Requires only **Read analytics** permission; shared users may call it. Optionally returns a widget bundle instead of the tracker.
### Method
GET
### Endpoint
`/api/v1/sites/{id}/snippet`
### Parameters
#### Path Parameters
- **id** (string) - Required - The site identifier.
#### Query Parameters
- **type** (string) - Optional - One of `globe`, `live-users`, `map`, or `countries`. Returns the widget bundle instead of the tracker. An unknown type returns `400`.
### Response
#### Success Response (200)
Returns the snippet (tracker or widget bundle).
#### Error Responses
- **400** - If an unknown `type` is provided.
```
--------------------------------
### Quick install script tag
Source: https://statable.com/docs/widgets/live-users
Basic installation snippet. Replace YOUR_PUBLIC_HASH with your actual hash. The real snippet is available in Site settings → Widget → Live Users with data-hash pre-filled.
```html
```
--------------------------------
### GET /api/v1/current-visitors response
Source: https://statable.com/docs/developers/stats-api/endpoints
Example response showing the site_id and visitor count. The response is a single JSON object with no pagination.
```json
{ "site_id": 3093477, "visitors": 42 }
```
--------------------------------
### statable keys create examples
Source: https://statable.com/docs/cli/commands
Examples of creating API keys with different options: name, scopes, expiry, and JSON output for capturing the token.
```bash
statable keys create ci
statable keys create deploy --scope read --scope sites:write
statable keys create tmp --expires-in 30
statable keys create ci --json | jq -r .token
```
--------------------------------
### GET /api/v1/props response
Source: https://statable.com/docs/developers/stats-api/endpoints
Example response listing custom properties. Each entry is a key and event pair, and the same key under two events is two entries.
```json
{
"props": [
{ "key": "plan", "event": "Signup", "count": 1240, "first_seen": "2026-06-01T10:00:00Z" },
{ "key": "method", "event": "Login", "count": 980, "first_seen": "2026-06-02T09:12:00Z" }
]
}
```
--------------------------------
### GET /api/v1/funnels response
Source: https://statable.com/docs/developers/stats-api/endpoints
Example response containing a funnel definition. Step kind is one of page, event, goal, scroll, entry_page, or exit_page, and remaining fields depend on the kind.
```json
{
"funnels": [
{
"id": 45,
"site_id": 3093477,
"name": "Signup flow",
"scope": "visitor",
"strict_order": false,
"steps": [
{ "kind": "page", "path": "/pricing", "operator": "e" },
{ "kind": "event", "event": "Signup" },
{ "kind": "goal", "goal_id": 9 }
],
"created_at": "2026-06-01T10:00:00Z",
"updated_at": "2026-06-01T10:00:00Z"
}
]
}
```
--------------------------------
### Excessive e-commerce analytics data (JSON)
Source: https://statable.com/docs/privacy-compliance/data-minimization
A JSON example of excessive data collection that should be excluded, including personal information (email, name, phone), excessive technical details (full user agent, screen resolution, installed plugins), and detailed behavioral data (mouse movements, scroll depth, time on elements).
```json
{
// Personal information
"user_email": "user@example.com",
"user_name": "John Smith",
"phone_number": "+31234567890",
// Excessive technical information
"full_user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)...",
"screen_resolution": "1920x1080",
"installed_plugins": ["flash", "java", "silverlight"],
// Detailed behavioral information
"mouse_movements": [...],
"scroll_depth_by_second": [...],
"time_spent_on_each_element": {...}
}
```
--------------------------------
### statable goals edit example
Source: https://statable.com/docs/cli/commands
Example of replacing a goal definition.
```bash
statable goals edit 3 --name Signup --event SignupCompleted
```
--------------------------------
### Quick install script tag
Source: https://statable.com/docs/widgets/map
Basic installation snippet. Replace YOUR_PUBLIC_HASH with your actual public hash. The real snippet is available in Site settings → Widget → Map with data-hash pre-filled.
```html
```
--------------------------------
### statable settings set hostnames example
Source: https://statable.com/docs/cli/commands
Example showing how to read the current hostname settings before replacing them. The second command replaces the hostname allow and block lists with the given allow list.
```bash
statable settings hostnames
statable settings set hostnames --allow example.com --allow www.example.com
```
--------------------------------
### statable settings set hostnames examples
Source: https://statable.com/docs/cli/commands
Examples of replacing hostname lists. The first sets an allow list. The second sets a block list. The third clears both lists.
```bash
statable settings set hostnames --allow example.com --allow www.example.com
statable settings set hostnames --block staging.example.com
statable settings set hostnames --clear
```
--------------------------------
### statable funnels edit example
Source: https://statable.com/docs/cli/commands
Example of replacing a funnel definition.
```bash
statable funnels edit 45 --name Signup --step page:/pricing --step event:Signup
```
--------------------------------
### Install via Homebrew
Source: https://statable.com/docs/cli
Installs the Statable CLI using Homebrew from the key-arg/tap tap. Includes man pages and shell completions for bash, zsh, and fish.
```bash
brew install key-arg/tap/statable
```
--------------------------------
### Default configuration example
Source: https://statable.com/docs/widgets/top-countries
Displays the top 10 countries over the last 7 days using percentages.
```html
```
--------------------------------
### statable funnels delete example
Source: https://statable.com/docs/cli/commands
Example of deleting a funnel with the --yes flag.
```bash
statable funnels delete 45 --yes
```