Getting Started
Deploy Flarelytics on Cloudflare in about 5 minutes. You'll need a Cloudflare account and Node.js.
Prerequisites
- A Cloudflare account (free tier works)
- Node.js 20 or later
- Wrangler CLI —
npm install -g wrangler - Cloudflare Analytics Engine enabled (available on all plans)
Log in to Wrangler before starting:
Clone & configure
Edit packages/worker/wrangler.toml with your values:
Find your
account_id on the Cloudflare dashboard under Workers & Pages — it's in the right sidebar on the overview page.
Deploy worker
After deploy, set the three required secrets:
Create the CF_API_TOKEN at dash.cloudflare.com/profile/api-tokens. Permissions required: Account > Account Analytics > Read.
Add tracking script
Add one script tag to your site's <head>. The script is auto-configured — no parameters needed.
Replace my-site-analytics with your worker name. If you prefer npm:
Enable scroll depth tracking (opt-in, uses IntersectionObserver):
Verify it works
Visit any page on your site, wait a few seconds, then run the query. You should see your path in the results.
View dashboard
Deploy the dashboard alongside your worker:
Open the dashboard URL from the deploy output and enter your QUERY_API_KEY when prompted. The dashboard works with multiple sites — use the site switcher to toggle between them.
Was this page helpful?