Quick Start
Get up and running in under two minutes โ no build step required.
Create your account
Sign up for a free account at simplestanalytics.com. No credit card required. Once you're in, add your first site from the dashboard โ you'll get a unique Site UUID instantly.
Add the snippet
Paste the one-line script tag into the <head> of every page you want to track. It's 2 KB, defers automatically, and works on any stack.
See your data
Open your dashboard. Pageviews appear in real time โ usually within a few seconds of the first visit. No sampling, no delays, no setup wizards.
Installation
Choose your platform. Replace YOUR-SITE-UUID with the UUID shown in your site settings.
Add the script tag to every page, ideally inside <head>.
<!-- Simplest Analytics -->
<script
async defer
src="https://simplestanalytics.forum/sa.js"
data-site="YOUR-SITE-UUID">
</script>
The script is 2 KB gzipped, loads asynchronously, and will never block your page render.
Event Tracking
Fire custom events from any JavaScript on your site using the global window.sa() function. Events appear in your dashboard within seconds.
Basic event
// sa_event is an alias for window.sa('event', ...)
window.sa('event', 'signup_click');
// or equivalently:
sa_event('signup_click');
Event with a value
Pass a numeric value to track revenue or score. You'll see totals and averages in the Events dashboard.
window.sa('event', 'purchase', { value: 49.00 });
Custom properties (metadata)
Attach up to 10 string/number properties to segment events later. Properties are visible in the event detail view.
window.sa('event', 'purchase', {
value: 49.00,
metadata: {
plan: 'team',
billing: 'annual',
coupon: 'LAUNCH20',
},
});
Automatic events
The script collects these automatically โ no code needed:
- Outbound link clicks โ Any link pointing to a different domain
- File downloads โ .pdf, .zip, .docx, .xlsx and other file extensions
- Email link clicks โ mailto: href links
- Client-side navigations โ pushState / popstate / hash changes
Opt-out / filtering
Add data-sa-ignore to any element to prevent its events from being tracked. You can also block your own visits in the dashboard under Settings โ Exclusions.
Goals
Goals let you measure conversions โ any pageview or event can become a goal. Create them under Sites โ Goals in your dashboard.
Triggers when a visitor lands on a specific URL or path pattern. Useful for thank-you pages, confirmation screens, or any destination page.
E.g. path equals /thank-you or path starts with /checkout/confirm
Triggers when a named custom event fires. Use this to track button clicks, form submissions, or any sa_event() call.
E.g. event name equals purchase
A variant of event goal that only converts when the event's numeric value exceeds a threshold. Perfect for revenue targets.
E.g. event purchase where value โฅ 50
Setting up a goal
- 1. Navigate to your site dashboard and click Goals in the sidebar.
- 2. Click + New Goal, choose the type, and enter the match criteria.
- 3. Optionally set a monetary value per conversion for revenue reporting.
- 4. Save. Goals appear on the dashboard immediately and backfill up to 90 days of historical data.
Funnels
Funnels visualise the step-by-step path visitors take through your site, and show exactly where they drop off.
How to create a funnel
Define your steps
A funnel is made of 2โ8 steps. Each step is either a pageview (URL match) or a custom event. Steps are evaluated in order โ a visitor must complete step N before they can advance to step N+1.
Name your funnel
Give it a descriptive name like "Signup flow" or "Checkout โ Purchase". This appears on your Funnels dashboard.
View the visualisation
Once created, the funnel shows a bar chart of visitors at each step, a % drop-off rate per step, and an overall conversion rate from first to last step.
Filter by segment
Apply any of your existing dashboard filters (country, device, source) to see how different audiences flow through the funnel.
Export data
Team plan users can export funnel step data as CSV from the Funnels screen.
API Reference
The REST API is available on Team plan and above. Authenticate using a Bearer token generated under Settings โ API Tokens.
Authentication
Authorization: Bearer YOUR_API_TOKEN
Endpoints
| Method & Path | Description | Plan |
|---|---|---|
| GET /api/v1/sites/{id}/stats | Aggregated stats (visitors, pageviews, bounce rate, top pages, sources) | Team+ |
| GET /api/v1/sites/{id}/events.csv | Raw event export as CSV | Team+ |
| GET /api/v1/sites/{id}/export/raw.csv | Raw pageview export as CSV | Team+ |
| GET /api/v1/sites/{id}/export/aggregated.json | Aggregated JSON export | Team+ |
Query parameters โ /stats
| Parameter | Type | Default | Description |
|---|---|---|---|
| period | string | 30d | 7d, 30d, 90d, 6mo, 12mo, or custom |
| start | date | โ | ISO 8601 date, required when period=custom |
| end | date | โ | ISO 8601 date, required when period=custom |
| timezone | string | UTC | IANA timezone, e.g. Europe/London |
| metrics | string | all | Comma-separated: visitors,pageviews,bounce_rate,duration |
Example requests
# Get stats for the last 30 days
curl -H "Authorization: Bearer YOUR_API_TOKEN" \
"https://simplestanalytics.forum/api/v1/sites/YOUR-SITE-UUID/stats?period=30d"
# Custom date range
curl -H "Authorization: Bearer YOUR_API_TOKEN" \
"https://simplestanalytics.forum/api/v1/sites/YOUR-SITE-UUID/stats?period=custom&start=2025-01-01&end=2025-01-31"
# Export raw events as CSV
curl -H "Authorization: Bearer YOUR_API_TOKEN" \
"https://simplestanalytics.forum/api/v1/sites/YOUR-SITE-UUID/events.csv?period=30d" \
-o events.csv
Example response
{
"site_id": "YOUR-SITE-UUID",
"period": "30d",
"visitors": 12840,
"pageviews": 38521,
"bounce_rate": 42.3,
"avg_visit_duration": 145,
"top_pages": [
{ "path": "/", "visitors": 4210, "pageviews": 6305 },
{ "path": "/pricing", "visitors": 1830, "pageviews": 2210 }
],
"top_sources": [
{ "source": "google.com", "visitors": 5400 },
{ "source": "direct", "visitors": 3200 }
]
}
Integrations
Simplest Analytics works out of the box with every major platform. Click any integration to see the dedicated guide.
Don't see your platform? The snippet works anywhere JavaScript runs. Ask us for a guide.
FAQ
Looking for answers to common questions? Check out our dedicated FAQ page covering privacy, billing, technical details, and comparisons.
Browse the FAQ