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.
Full-control, simple, and extensible.
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.
~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.
Every event lands in BigQuery as-is. No pre-aggregation, no sampling, no waiting for exports. Be clear what really happens.
Need a custom field? Add it. Different enrichment logic? Change it. The code is simple enough to modify confidently.
Runs on your GCP project. Data never leaves your environment. Full control over retention, access, and compliance.
Daily-rotating hashes for cookieless tracking. IP truncation. You can explain exactly how it works because you can read it.
Raw events transform via dbt models into session and user tables. Add your own models, join with other data sources, build custom metrics.
Prerequisites: Google Cloud CLI installed and authenticated.
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
./deploy_app.sh # Deploy tracking API
./deploy_dbt.sh # Deploy analytics pipeline
<script src="https://your-tracker-url/measure.js"></script>
<script>
_measure.pageview();
_measure.event('signup_click', { plan: 'pro' });
</script>
-- 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;
Event hits API, gets enriched (device, location), stored in BigQuery. That's it. No queues, no complex pipelines, no hidden processing.
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:
Hash = SHA256(IP + UserAgent + DailySalt). Salt rotates and deletes after 24h. IP truncated before storage. All in src/services/salt.ts - read it yourself.
| measure |
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) |
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.