EthicalMetrics was born from a simple frustration: every time we implemented Google Analytics, we felt like we were betraying our users' trust.
What if analytics could be both powerful AND ethical?
EthicalMetrics is our answer - a next-generation web analytics platform that delivers meaningful insights while protecting your users' privacy as a fundamental right, not an afterthought.
No cookies. No fingerprinting. No personal data. No compromises.
Important
EthicalMetrics is currently in beta. It is stable, but may still undergo breaking changes before v1.0. Recommended for technical users and privacy-focused teams.
-
True Anonymity by Design
No IP collection. No device fingerprinting. No persistent IDs.
100% anonymous, with no way to track individual users β by default. -
Self-Hosted, Zero External Dependencies
No third-party scripts, CDNs, or vendors. You own your data. -
End-to-End Encryption
Data is protected at rest using Redis. Built-in, not bolted on. -
Core, Actionable Metrics
Track visits, module usage, performance, events, and engagement β not people. -
Lightweight & Easy to Use
A single vanilla JS snippet. No frameworks. No bloat.
Ethical by default β even without configuration. -
Flexible Open API
Send custom events and modules programmatically with minimal overhead. -
Private Dashboards per Site
Each site has its own dashboard secured with token-based access. -
Portable by Nature
Works on VPS, Docker, Render, or local environments. No lock-in.
EthicalMetrics exists to prove that analytics can be useful without being creepy.
π Read the Ethical Analytics Manifesto in FUNDAMENTALS.md
EthicalMetrics is growing fast β without compromising ethics.
π Check out the roadmap here
In a world where 96% of websites track users without consent, EthicalMetrics represents a different path forward:
- For Developers: Build with confidence knowing you're respecting user privacy
- For Businesses: Gain insights without legal compliance headaches (GDPR, CCPA ready)
- For Users: Browse freely without being surveilled and profiled
- For the Web: Help create an internet that serves people, not advertisers
Join thousands of developers who are choosing ethics over surveillance capitalism.
Understanding how EthicalMetrics works internally helps you make the most of its privacy-first approach. The following diagrams illustrate the system's core components and data flow.
The complete EthicalMetrics system consists of four main layers working together:
flowchart TD
%% Clusters/Groups
subgraph Client_Layer
Website["Website Integration"]
ethicalmetrics_js["ethicalmetrics.js"]
end
subgraph Web_Interface
nuevo_html["pricing.html"]
dashboard_html["dashboard.html"]
index_html["index.html"]
end
subgraph Server_Layer
main_go["cmd/server/main.go"]
handlers_go["internal/api/handlers.go"]
end
subgraph Data_Layer
database_go["internal/db/database.go"]
event_go["internal/models/event.go"]
metrics_db["Redis"]
sites_table["sites"]
events_table["events"]
end
%% Connections
Website --> ethicalmetrics_js
ethicalmetrics_js -.-> handlers_go
dashboard_html -.-> handlers_go
index_html -.-> handlers_go
main_go --> handlers_go
main_go --> nuevo_html
main_go --> dashboard_html
main_go --> index_html
handlers_go --> database_go
handlers_go --> event_go
database_go --> metrics_db
metrics_db --> sites_table
metrics_db --> events_table
%% Style for dotted lines
linkStyle 2,3,4 stroke:#999,stroke-dasharray:3
EthicalMetrics follows a simple three-stage process from registration to analytics:
flowchart TD
%% Main Nodes
START["Website Owner Starts"]
REGISTER["Site Registration"]
INTEGRATE["Client Integration"]
ANALYTICS["View Analytics"]
NUEVO_HANDLER["/nuevo API Endpoint"]
TRACK_HANDLER["/track API Endpoint"]
STATS_HANDLER["/stats API Endpoint"]
REDIS_SITES["Redis Sites Storage"]
REDIS_EVENTS["Redis Events Storage"]
QUERY_DATA["Query aggregated data"]
SITE_ID["site_id + admin_token"]
EVENT_STORAGE["Anonymous Event Storage"]
DASHBOARD_DATA["por_modulo + por_dia stats"]
%% Connections
START --> REGISTER
REGISTER --> INTEGRATE
REGISTER --> NUEVO_HANDLER
INTEGRATE --> ANALYTICS
INTEGRATE --> TRACK_HANDLER
ANALYTICS --> STATS_HANDLER
NUEVO_HANDLER --> REDIS_SITES
TRACK_HANDLER --> REDIS_EVENTS
STATS_HANDLER --> QUERY_DATA
REDIS_SITES --> SITE_ID
REDIS_EVENTS --> EVENT_STORAGE
QUERY_DATA --> DASHBOARD_DATA
%% Styling for better visualization
classDef process fill:#e1f5fe,stroke:#039be5
classDef storage fill:#e8f5e9,stroke:#43a047
classDef endpoint fill:#fff3e0,stroke:#fb8c00
classDef data fill:#f3e5f5,stroke:#8e24aa
class START,REGISTER,INTEGRATE,ANALYTICS process
class NUEVO_HANDLER,TRACK_HANDLER,STATS_HANDLER endpoint
class REDIS_SITES,REDIS_EVENTS,QUERY_DATA storage
class SITE_ID,EVENT_STORAGE,DASHBOARD_DATA data
The system exposes three main API endpoints that handle all core functionality:
flowchart TD
%% Clusters/Groups
subgraph HTTP_Endpoints
track_endpoint["/track"]
nuevo_endpoint["/nuevo"]
stats_endpoint["/stats"]
static_endpoint["/static/*"]
end
subgraph Handler_Functions
TrackHandler["TrackHandler"]
NuevoHandler["NuevoHandler"]
StatsHandler["StatsHandler"]
StaticHandler["http.FileServer"]
end
subgraph Database_Operations
InsertEvent["INSERT INTO events"]
InsertSite["INSERT INTO sites"]
SelectStats["SELECT aggregated data"]
end
subgraph Response_Data
EventModel["models.Event"]
SiteResponse["site_id + admin_token"]
StatsResponse["por_modulo + por_dia"]
end
%% Connections
track_endpoint --> TrackHandler
nuevo_endpoint --> NuevoHandler
stats_endpoint --> StatsHandler
static_endpoint --> StaticHandler
TrackHandler --> InsertEvent
NuevoHandler --> InsertSite
StatsHandler --> SelectStats
InsertEvent --> EventModel
InsertSite --> SiteResponse
SelectStats --> StatsResponse
%% Styling
classDef endpoint fill:#e3f2fd,stroke:#1976d2
classDef handler fill:#e8f5e9,stroke:#388e3c
classDef db_operation fill:#fff3e0,stroke:#ffa000
classDef response fill:#f3e5f5,stroke:#8e24aa
class HTTP_Endpoints endpoint
class Handler_Functions handler
class Database_Operations db_operation
class Response_Data response
Average session duration:
Weekly comparison:
Retention per page:
Token Generation
Visit ethicalmetrics.onrender.com and click "Create Account" - no email required!
<script src="https://ethicalmetrics.leapcell.app/ethicalmetrics.js?id=YOUR_SITE_ID"></script>Access your private dashboard instantly - that's it! π
Want advanced features? Sponsor the project for early access to Professional analytics tools.
Ultra-simple banner customization:
You can easily customize the consent banner by adding data-* attributes to the script tag:
<script
src="https://ethicalmetrics.leapcell.app/ethicalmetrics.js?id=YOUR_SITE_ID"
data-banner-bg="#222"
data-banner-color="#fff"
data-banner-btn-bg="#4a90e2"
data-banner-btn-color="#fff"
data-banner-text="We respect your privacy. DNT is enabled. Only if you accept, we collect anonymous analytics."
data-banner-btn-text="Accept"
></script>Domain restriction banner customization:
If the tracker is used on a non-registered domain, it can show a warning banner. You can customize it using:
<script
src="https://ethicalmetrics.leapcell.app/ethicalmetrics.js?id=YOUR_SITE_ID"
data-domain-banner-text="This script can only be used on the registered domain."
data-domain-banner-bg="#fff5f5"
data-domain-banner-color="#7f1d1d"
data-domain-banner-border="#fecaca"
></script>Change colors and text as you wish β no coding required!
- Optionally, define a custom module for richer context:
<body data-modulo="home">
...
<script src="https://ethicalmetrics.leapcell.app/ethicalmetrics.js?id=YOUR_SITE_ID"></script>
</body>- Access your private dashboard:
https://ethicalmetrics.leapcell.app/dashboard.html?site=YOUR_SITE_ID&token=YOUR_ADMIN_TOKEN
EthicalMetrics is more than software - it's a statement that privacy and analytics can coexist.
- π° Sponsor the project - Fund development and get exclusive access
- π Report issues - Help us improve
- π§ Submit PRs - Code contributions welcome
- π Help translate - Make it accessible worldwide. Some of these translations are done by AI, which may not be of the highest quality.
- π’ Spread the word - Share with fellow privacy advocates
Every contribution helps build a more ethical web.
Made with π by @livrasand.
π‘οΈ Ethical by design. Anonymous by default. Metrics with ethics. Do EthicalMetrics!
This project is available under a dual license model:
- GNU GPL v3 for personal, educational, or compatible open source use.
- EthicalMetrics Commercial License for commercial, SaaS, or proprietary products.
For a commercial license, see LICENSE-COMMERCIAL.md.
If you use EthicalMetrics in research or documentation, please cite it as follows:
Sandoval, L. (2025). livrasand/EthicalMetrics: v0.1.0-alpha (v0.1.0-alpha). Zenodo. https://doi.org/10.5281/zenodo.16121940