Counterscale logo

Counterscale

Self-hosted web analytics on Cloudflare's edge network

Deploy privacy-focused web analytics on Cloudflare Workers with near-zero operating costs. Track up to 100k daily hits on the free tier with a simple dashboard.

Counterscale banner

Overview

Overview

Counterscale is a self-hosted web analytics solution built specifically for Cloudflare's edge infrastructure. Designed for developers and site owners who want simple, cost-effective traffic insights without third-party data sharing, it leverages Cloudflare Workers and Analytics Engine to deliver real-time metrics at minimal expense.

Who It's For

Ideal for individual developers, small businesses, and teams already using Cloudflare who need straightforward pageview tracking without the complexity or cost of enterprise analytics platforms. The free tier supports up to 100,000 hits per day, making it accessible for most small-to-medium traffic sites.

Deployment & Capabilities

Deployment takes minutes via the included CLI installer. After authenticating with Cloudflare, the tool provisions a Worker, configures Analytics Engine, and optionally sets password protection for your dashboard. Integration is flexible: embed the tracker via CDN script tag or install the npm package for programmatic control, including manual pageview tracking for single-page applications.

Important constraint: Cloudflare Workers Analytics Engine currently retains data for a maximum of 90 days, so historical analysis beyond that window is not possible.

Highlights

Runs entirely on Cloudflare's free tier with support for 100k daily hits
90-day data retention powered by Workers Analytics Engine
One-command CLI deployment with optional password protection
Flexible tracker integration via CDN script or npm package

Pros

  • Near-zero operating costs on Cloudflare's free tier
  • Fast deployment with minimal configuration required
  • No third-party data sharing; you control all analytics data
  • Lightweight tracker with manual pageview control for SPAs

Considerations

  • Maximum 90-day data retention due to Analytics Engine limits
  • Requires active Cloudflare account and Workers setup
  • Limited to macOS or Linux for installation and management
  • No advanced analytics features like funnels or cohort analysis

Managed products teams compare with

When teams consider Counterscale, these hosted platforms usually appear on the same shortlist.

Amplitude logo

Amplitude

Product analytics platform for tracking user behavior and generating data-driven insights

Contentsquare logo

Contentsquare

Digital experience analytics for UX insights and conversion

Fathom Analytics logo

Fathom Analytics

Privacy-focused web analytics alternative to Google Analytics

Looking for a hosted option? These are the services engineering teams benchmark against before choosing open source.

Fit guide

Great for

  • Developers already using Cloudflare for hosting or CDN
  • Privacy-conscious site owners wanting self-hosted analytics
  • Small-to-medium traffic sites under 100k daily pageviews
  • Teams needing simple dashboards without vendor lock-in

Not ideal when

  • Organizations requiring historical data beyond 90 days
  • Windows-only development environments without WSL
  • Sites needing advanced features like conversion funnels or A/B testing
  • Teams unfamiliar with Cloudflare Workers or CLI tooling

How teams use it

Personal Blog Traffic Monitoring

Track daily readership and referral sources without monthly SaaS fees or third-party cookies.

SaaS Landing Page Analytics

Monitor marketing campaign performance and visitor geography while keeping data in-house on Cloudflare's edge.

Documentation Site Insights

Understand which docs pages receive the most traffic to prioritize content updates and improvements.

Portfolio or Agency Site Tracking

Demonstrate site engagement to clients with a self-hosted dashboard that requires no ongoing subscription.

Tech snapshot

TypeScript97%
JavaScript2%
HTML1%
CSS1%
Shell1%

Tags

google-analyticsanalyticswebsite-statscloudflare-workerscloudflare-analytics

Frequently asked questions

Does Counterscale work on Cloudflare's free tier?

Yes. The free tier can hypothetically support up to 100,000 hits per day, making it cost-effective for most small-to-medium traffic sites.

Why is data retention limited to 90 days?

Counterscale relies on Cloudflare Workers Analytics Engine, which currently enforces a maximum 90-day retention policy as of February 2025.

Can I use Counterscale on Windows?

The CLI installer requires macOS or Linux. Windows users may be able to use WSL (Windows Subsystem for Linux), though this is not officially documented.

How do I protect my dashboard from public access?

During installation, choose 'Yes' when prompted to enable password protection. You can also manage authentication later using the 'npx @counterscale/cli auth' commands.

Can I track single-page applications (SPAs)?

Yes. Initialize the tracker with 'autoTrackPageviews: false' and manually call 'Counterscale.trackPageview()' on route changes or navigation events.

Project at a glance

Active
Stars
1,959
Watchers
1,959
Forks
95
LicenseMIT
Repo age2 years old
Last commitlast month
Self-hostingSupported
Primary languageTypeScript

Last synced 10 hours ago