Getting Started
Get Once Analytics running on your website in under 5 minutes.
Requirements
- A Cloudflare account (free tier works)
- A domain connected to Cloudflare
Tip: Cloudflare free tier includes 100,000 Worker requests/day and 5GB D1 storage. This covers most small-to-medium sites comfortably.
Installation
After purchase, the web installer guides you through these steps:
- Create API Token — Click the provided link to create a pre-configured Cloudflare API token with exactly the permissions needed
- Choose Authentication — Protect your dashboard with a PIN code (recommended) or Cloudflare Access (Zero Trust)
- Select Domain — Pick which domain to use from your Cloudflare account
- Choose Subdomain — Enter a subdomain like
statsoranalytics(final URL:stats.yoursite.com) - Automatic Setup — The installer creates your Worker, database, DNS record, and routing
The entire process takes about 2 minutes.
Note: Your API token is only used during installation and is never stored. You can delete it from Cloudflare after installation completes. See API Token Usage for details.
Adding the tracking script
After installation, add this script to your website's <head>:
<script defer src="https://stats.yoursite.com/script.js"></script>Replace stats.yoursite.com with your actual analytics subdomain.
For WordPress: Add to your theme's header.php or use a plugin like "Insert Headers and Footers".
For Next.js/React: Add to your _document.js or root layout.
For static sites: Add to every HTML page's <head> section.
Verify installation
- Visit your website in a browser
- Open your analytics dashboard at
https://stats.yoursite.com/dashboard - You should see your pageview appear within seconds
Next steps
- Dashboard Guide — Learn how to read your analytics
- Custom Events — Track signups, purchases, and more
- Privacy Modes — Choose the right privacy level
- Conversions — Set up conversion tracking
Need help? Email hello@onceanalytics.com