measureStack The Sovereign Analytics Stack

Full-control, simple, and extensible.

Exact Event Data Privacy-aware Scale to Zero MIT License

Most analytics tools are black boxes. You can't see how events are processed, can't access raw data, can't adapt the schema. measureStack is different: understand the entire codebase, query every event, change anything.

Built for Data Professionals

Understand Every Line

~1kB tracker size, 500 lines server code, 10 dbt models. No magic, no abstraction layers. Understand how events flow from browser to BigQuery in 30 minutes.

Query Raw Events

Every event lands in BigQuery as-is. No pre-aggregation, no sampling, no waiting for exports. Be clear what really happens.

Adapt, No Limits

Need a custom field? Add it. Different enrichment logic? Change it. The code is simple enough to modify confidently.

Your Infrastructure

Runs on your GCP project. Data never leaves your environment. Full control over retention, access, and compliance.

Privacy That Makes Sense

Daily-rotating hashes for cookieless tracking. IP truncation. You can explain exactly how it works because you can read it.

dbt-Native Pipeline

Raw events transform via dbt models into session and user tables. Add your own models, join with other data sources, build custom metrics.

Quick Start

Prerequisites: Google Cloud CLI installed and authenticated.

1. Clone & Configure

git clone https://github.com/measurestack/measure-stack.git
cd measure-stack/deploy
cp config.source.template config.source
# Edit config.source with your GCP project ID and domain

2. Deploy

./deploy_app.sh      # Deploy tracking API
./deploy_dbt.sh      # Deploy analytics pipeline

3. Add to Your Site

<script src="https://your-tracker-url/measure.js"></script>
<script>
  _measure.pageview();
  _measure.event('signup_click', { plan: 'pro' });
</script>

4. Query Your Data

-- Your events, your SQL, no restrictions
SELECT
  DATE(timestamp) as day,
  event_name,
  COUNT(*) as events,
  COUNT(DISTINCT hash) as unique_visitors
FROM `your-project.measure_js.events`
WHERE timestamp > TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
GROUP BY 1, 2
ORDER BY 1 DESC, 3 DESC;

Architecture

measureStack Architecture: Browser sends events to Hono API, stored in BigQuery (raw events + analytics tables via dbt), consumed by BI tools.

Event hits API, gets enriched (device, location), stored in BigQuery. That's it. No queues, no complex pipelines, no hidden processing.

Why Simplicity Matters

When something breaks at 2am, you need to understand what's happening. When stakeholders ask "how is this metric calculated?", you need a real answer. When regulations change, you need to adapt fast.

With ~500 lines of code, you can:

  • Debug in minutes - grep the codebase, find the issue, fix it
  • Explain your data - show exactly how each field is computed
  • Adapt to requirements - add fields, change logic, no vendor tickets
  • Onboard teammates - they can read the entire system in a day

Privacy Model

With Consent

  • Persistent client ID cookie
  • Cross-session tracking
  • Return visitor analysis

Without Consent

  • Daily-rotating SHA-256 hash
  • Same-day sessions only
  • No cookies, GDPR-ready

Hash = SHA256(IP + UserAgent + DailySalt). Salt rotates and deletes after 24h. IP truncated before storage. All in src/services/salt.ts - read it yourself.

Comparison

measureStack Google Analytics Plausible / Matomo
Can you read the code? Yes, ~500 lines No Yes, 100k+ lines
Raw event SQL access Direct BigQuery Export only Limited / Plugin
Modify tracking logic Edit source Not possible Complex plugins
Data location Your GCP project Google servers Self-host or SaaS
Setup time minutes mins (SaaS only) days (self-host) / mins (SaaS)
Pricing Cloud costs (free tier possible) with scale to zero Free (you are the product) from $9+/mo or cloud costs (self-host)

Stack

Runtime: Bun  |  Framework: Hono  |  Storage: BigQuery  |  Transforms: dbt  |  Deploy: Cloud Run

All standard tools. If you've used any of these, you already know half the stack.

Read the code. Deploy in 5 minutes. Own your data.

View on GitHub