{"id":29830853,"url":"https://github.com/livrasand/ethicalmetrics","last_synced_at":"2026-02-06T08:31:50.008Z","repository":{"id":301260835,"uuid":"1007359910","full_name":"livrasand/EthicalMetrics","owner":"livrasand","description":"A privacy-focused, open-source web analytics platform designed as a powerful alternative to Google Analytics. Powered by an active community dedicated to ethical data tracking.","archived":false,"fork":false,"pushed_at":"2026-01-26T23:22:25.000Z","size":38050,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-06T03:50:00.211Z","etag":null,"topics":["alternative","analytics","charts","cloud-native","ethical-analytics","ethical-metrics","gdpr","go","golang","google-analytics","google-analytics-alternative","marketing","metrics","open-source","product-analytics","real-time","self-hosted","selfhosted","statistics","web-analytics"],"latest_commit_sha":null,"homepage":"https://ethicalmetrics.leapcell.app","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/livrasand.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"livrasand","issuehunt":"livrasand","message":"❤️ Your support helps us keep EthicalMetrics free, open-source, and privacy-focused!"}},"created_at":"2025-06-23T21:52:06.000Z","updated_at":"2026-01-26T23:22:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"895ed7e0-95d3-45b5-ae76-004fb9203872","html_url":"https://github.com/livrasand/EthicalMetrics","commit_stats":null,"previous_names":["livrasand/ethicalmetrics"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/livrasand/EthicalMetrics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livrasand%2FEthicalMetrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livrasand%2FEthicalMetrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livrasand%2FEthicalMetrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livrasand%2FEthicalMetrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/livrasand","download_url":"https://codeload.github.com/livrasand/EthicalMetrics/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livrasand%2FEthicalMetrics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29155385,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T07:18:23.844Z","status":"ssl_error","status_checked_at":"2026-02-06T07:13:32.659Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alternative","analytics","charts","cloud-native","ethical-analytics","ethical-metrics","gdpr","go","golang","google-analytics","google-analytics-alternative","marketing","metrics","open-source","product-analytics","real-time","self-hosted","selfhosted","statistics","web-analytics"],"created_at":"2025-07-29T10:12:15.892Z","updated_at":"2026-02-06T08:31:50.002Z","avatar_url":"https://github.com/livrasand.png","language":"HTML","funding_links":["https://github.com/sponsors/livrasand","https://issuehunt.io/r/livrasand","❤️ Your support helps us keep EthicalMetrics free, open-source, and privacy-focused!"],"categories":[],"sub_categories":[],"readme":"# EthicalMetrics\n\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/livrasand/EthicalMetrics) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.16121940.svg)](https://doi.org/10.5281/zenodo.16121940) [![Go Report Card](https://img.shields.io/badge/go%20report-A+-brightgreen.svg?style=flat)](https://goreportcard.com/report/github.com/livrasand/ethicalmetrics) [![Crowdin](https://badges.crowdin.net/ethicalmetrics/localized.svg)](https://crowdin.com/project/ethicalmetrics)\n\n**EthicalMetrics** was born from a simple frustration: every time we implemented Google Analytics, we felt like we were betraying our users' trust.  \n  \n**What if analytics could be both powerful AND ethical?**  \n  \nEthicalMetrics 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.**  \n  \nNo cookies. No fingerprinting. No personal data. No compromises.\n\n\u003e [!IMPORTANT]\n\u003e EthicalMetrics is in a pre-alpha state, and only suitable for use by developers\n\u003e\n\n---\n\n## Why EthicalMetrics?\n\n- **True Anonymity by Design**  \n  No IP collection. No device fingerprinting. No persistent IDs.  \n  100% anonymous, with no way to track individual users — by default.\n\n- **Self-Hosted, Zero External Dependencies**  \n  No third-party scripts, CDNs, or vendors. You own your data.\n\n- **End-to-End Encryption**  \n  Data is protected at rest using Redis. Built-in, not bolted on.\n\n- **Core, Actionable Metrics**  \n  Track visits, module usage, performance, events, and engagement — not people.\n\n- **Lightweight \u0026 Easy to Use**  \n  A single vanilla JS snippet. No frameworks. No bloat.  \n  Ethical by default — even without configuration.\n\n- **Flexible Open API**  \n  Send custom events and modules programmatically with minimal overhead.\n\n- **Private Dashboards per Site**  \n  Each site has its own dashboard secured with token-based access.\n\n- **Portable by Nature**  \n  Works on VPS, Docker, Render, or local environments. No lock-in.\n\nEthicalMetrics exists to prove that **analytics can be useful without being creepy.**  \n👉 [Read the Ethical Analytics Manifesto in `FUNDAMENTALS.md`](./FUNDAMENTALS.md)\n\nEthicalMetrics is growing fast — without compromising ethics.  \n👉 [Check out the roadmap here](./ROADMAP.md)\n\n## Why This Matters  \n  \nIn a world where **96% of websites** track users without consent, EthicalMetrics represents a different path forward:  \n  \n- **For Developers**: Build with confidence knowing you're respecting user privacy  \n- **For Businesses**: Gain insights without legal compliance headaches (GDPR, CCPA ready)  \n- **For Users**: Browse freely without being surveilled and profiled  \n- **For the Web**: Help create an internet that serves people, not advertisers  \n  \n*Join thousands of developers who are choosing ethics over surveillance capitalism.*\n\n---\n\n## Architecture Overview\n\nUnderstanding 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.\n\n### System Architecture\n\nThe complete EthicalMetrics system consists of four main layers working together:\n\n```mermaid\nflowchart TD\n    %% Clusters/Groups\n    subgraph Client_Layer\n        Website[\"Website Integration\"]\n        ethicalmetrics_js[\"ethicalmetrics.js\"]\n    end\n\n    subgraph Web_Interface\n        nuevo_html[\"pricing.html\"]\n        dashboard_html[\"dashboard.html\"]\n        index_html[\"index.html\"]\n    end\n\n    subgraph Server_Layer\n        main_go[\"cmd/server/main.go\"]\n        handlers_go[\"internal/api/handlers.go\"]\n    end\n\n    subgraph Data_Layer\n        database_go[\"internal/db/database.go\"]\n        event_go[\"internal/models/event.go\"]\n        metrics_db[\"Redis\"]\n        sites_table[\"sites\"]\n        events_table[\"events\"]\n    end\n\n    %% Connections\n    Website --\u003e ethicalmetrics_js\n    ethicalmetrics_js -.-\u003e handlers_go\n    dashboard_html -.-\u003e handlers_go\n    index_html -.-\u003e handlers_go\n\n    main_go --\u003e handlers_go\n    main_go --\u003e nuevo_html\n    main_go --\u003e dashboard_html\n    main_go --\u003e index_html\n\n    handlers_go --\u003e database_go\n    handlers_go --\u003e event_go\n\n    database_go --\u003e metrics_db\n    metrics_db --\u003e sites_table\n    metrics_db --\u003e events_table\n\n    %% Style for dotted lines\n    linkStyle 2,3,4 stroke:#999,stroke-dasharray:3\n```\n\n### User Workflow\n\nEthicalMetrics follows a simple three-stage process from registration to analytics:\n\n```mermaid\nflowchart TD\n    %% Main Nodes\n    START[\"Website Owner Starts\"]\n    REGISTER[\"Site Registration\"]\n    INTEGRATE[\"Client Integration\"]\n    ANALYTICS[\"View Analytics\"]\n    NUEVO_HANDLER[\"/nuevo API Endpoint\"]\n    TRACK_HANDLER[\"/track API Endpoint\"]\n    STATS_HANDLER[\"/stats API Endpoint\"]\n    REDIS_SITES[\"Redis Sites Storage\"]\n    REDIS_EVENTS[\"Redis Events Storage\"]\n    QUERY_DATA[\"Query aggregated data\"]\n    SITE_ID[\"site_id + admin_token\"]\n    EVENT_STORAGE[\"Anonymous Event Storage\"]\n    DASHBOARD_DATA[\"por_modulo + por_dia stats\"]\n\n    %% Connections\n    START --\u003e REGISTER\n    REGISTER --\u003e INTEGRATE\n    REGISTER --\u003e NUEVO_HANDLER\n    INTEGRATE --\u003e ANALYTICS\n    INTEGRATE --\u003e TRACK_HANDLER\n    ANALYTICS --\u003e STATS_HANDLER\n    NUEVO_HANDLER --\u003e REDIS_SITES\n    TRACK_HANDLER --\u003e REDIS_EVENTS\n    STATS_HANDLER --\u003e QUERY_DATA\n    REDIS_SITES --\u003e SITE_ID\n    REDIS_EVENTS --\u003e EVENT_STORAGE\n    QUERY_DATA --\u003e DASHBOARD_DATA\n\n    %% Styling for better visualization\n    classDef process fill:#e1f5fe,stroke:#039be5\n    classDef storage fill:#e8f5e9,stroke:#43a047\n    classDef endpoint fill:#fff3e0,stroke:#fb8c00\n    classDef data fill:#f3e5f5,stroke:#8e24aa\n\n    class START,REGISTER,INTEGRATE,ANALYTICS process\n    class NUEVO_HANDLER,TRACK_HANDLER,STATS_HANDLER endpoint\n    class REDIS_SITES,REDIS_EVENTS,QUERY_DATA storage\n    class SITE_ID,EVENT_STORAGE,DASHBOARD_DATA data\n```\n\n### API Endpoints\n\nThe system exposes three main API endpoints that handle all core functionality:\n\n```mermaid\nflowchart TD\n    %% Clusters/Groups\n    subgraph HTTP_Endpoints\n        track_endpoint[\"/track\"]\n        nuevo_endpoint[\"/nuevo\"]\n        stats_endpoint[\"/stats\"]\n        static_endpoint[\"/static/*\"]\n    end\n\n    subgraph Handler_Functions\n        TrackHandler[\"TrackHandler\"]\n        NuevoHandler[\"NuevoHandler\"]\n        StatsHandler[\"StatsHandler\"]\n        StaticHandler[\"http.FileServer\"]\n    end\n\n    subgraph Database_Operations\n        InsertEvent[\"INSERT INTO events\"]\n        InsertSite[\"INSERT INTO sites\"]\n        SelectStats[\"SELECT aggregated data\"]\n    end\n\n    subgraph Response_Data\n        EventModel[\"models.Event\"]\n        SiteResponse[\"site_id + admin_token\"]\n        StatsResponse[\"por_modulo + por_dia\"]\n    end\n\n    %% Connections\n    track_endpoint --\u003e TrackHandler\n    nuevo_endpoint --\u003e NuevoHandler\n    stats_endpoint --\u003e StatsHandler\n    static_endpoint --\u003e StaticHandler\n\n    TrackHandler --\u003e InsertEvent\n    NuevoHandler --\u003e InsertSite\n    StatsHandler --\u003e SelectStats\n\n    InsertEvent --\u003e EventModel\n    InsertSite --\u003e SiteResponse\n    SelectStats --\u003e StatsResponse\n\n    %% Styling\n    classDef endpoint fill:#e3f2fd,stroke:#1976d2\n    classDef handler fill:#e8f5e9,stroke:#388e3c\n    classDef db_operation fill:#fff3e0,stroke:#ffa000\n    classDef response fill:#f3e5f5,stroke:#8e24aa\n\n    class HTTP_Endpoints endpoint\n    class Handler_Functions handler\n    class Database_Operations db_operation\n    class Response_Data response\n```\n\n# Algorithms\n\n**Average session duration:**\n\n```math\n\\bar{D} = \\frac{1}{N} \\sum _{i=1}^{N} d_i \\quad \\text{(where } d_i \u003e 0\\text{)}\n```\n\n---\n\n**Weekly comparison:**\n\n```math\nW_{\\text{current}}[d] = \\sum _{e \\in E_{\\text{current}}} \\mathbb{I}(\\text{day}(e) = d)\n```\n\n---\n\n**Retention per page:**\n\n```math\nR_p = \\left| \\{ \\text{date}(e) \\mid e \\in E_p \\} \\right|\n```\n\n---\n\n**Token Generation**\n\n```math\n\\text{Token} = \\bigoplus _{i=1}^{24} \\text{charset}[\\lfloor 62 \\cdot U(0,1) \\rfloor]\n```\n\n---\n\n## 🚀 Get Started in 60 Seconds  \n  \n### Step 1: Get Your Credentials  \nVisit [ethicalmetrics.onrender.com](https://ethicalmetrics.leapcell.app) and click \"Create Account\" - no email required!  \n  \n### Step 2: Add One Line of Code  \n```html  \n\u003cscript src=\"https://ethicalmetrics.leapcell.app/ethicalmetrics.js?id=YOUR_SITE_ID\"\u003e\u003c/script\u003e\n```\n\n### Step 3: View Your Analytics\nAccess your private dashboard instantly - that's it! 🎉\n\nWant advanced features? [Sponsor the project](https://github.com/sponsors/livrasand) for early access to Professional analytics tools.\n\n**Ultra-simple banner customization:**  \nYou can easily customize the consent banner by adding `data-*` attributes to the script tag:\n\n```html\n\u003cscript\n  src=\"https://ethicalmetrics.leapcell.app/ethicalmetrics.js?id=YOUR_SITE_ID\"\n  data-banner-bg=\"#222\"\n  data-banner-color=\"#fff\"\n  data-banner-btn-bg=\"#4a90e2\"\n  data-banner-btn-color=\"#fff\"\n  data-banner-text=\"We respect your privacy. DNT is enabled. Only if you accept, we collect anonymous analytics.\"\n  data-banner-btn-text=\"Accept\"\n\u003e\u003c/script\u003e\n```\n\n**Domain restriction banner customization:**  \nIf the tracker is used on a non-registered domain, it can show a warning banner. You can customize it using:\n\n```html\n\u003cscript\n  src=\"https://ethicalmetrics.leapcell.app/ethicalmetrics.js?id=YOUR_SITE_ID\"\n  data-domain-banner-text=\"This script can only be used on the registered domain.\"\n  data-domain-banner-bg=\"#fff5f5\"\n  data-domain-banner-color=\"#7f1d1d\"\n  data-domain-banner-border=\"#fecaca\"\n\u003e\u003c/script\u003e\n```\n\nChange colors and text as you wish — no coding required!\n\n4. Optionally, define a custom module for richer context:\n\n```html\n\u003cbody data-modulo=\"home\"\u003e\n  ...\n  \u003cscript src=\"https://ethicalmetrics.leapcell.app/ethicalmetrics.js?id=YOUR_SITE_ID\"\u003e\u003c/script\u003e\n\u003c/body\u003e\n```\n\n5. Access your private dashboard:\n\n```\nhttps://ethicalmetrics.leapcell.app/dashboard.html?site=YOUR_SITE_ID\u0026token=YOUR_ADMIN_TOKEN\n```\n\n---\n\n## Join the Movement  \n  \nEthicalMetrics is more than software - it's a statement that **privacy and analytics can coexist**.  \n  \n### Ways to Contribute:  \n- 💰 **[Sponsor the project](https://github.com/sponsors/livrasand)** - Fund development and get exclusive access  \n- 🐛 **[Report issues](https://github.com/livrasand/EthicalMetrics/issues)** - Help us improve  \n- 🔧 **[Submit PRs](https://github.com/livrasand/EthicalMetrics/pulls)** - Code contributions welcome  \n- 🌍 **[Help translate](https://crowdin.com/project/ethicalmetrics)** - Make it accessible worldwide. Some of these translations are done by AI, which may not be of the highest quality.\n- 📢 **Spread the word** - Share with fellow privacy advocates  \n  \n**Every contribution helps build a more ethical web.**\n\nMade with 💚 by [@livrasand](https://github.com/livrasand).\n\n---\n\n**🛡️ Ethical by design. Anonymous by default. Metrics with ethics. Do EthicalMetrics!**\n\n## License\n\nThis project is available under a dual license model:\n\n- **GNU GPL v3** for personal, educational, or compatible open source use.\n- **EthicalMetrics Commercial License** for commercial, SaaS, or proprietary products.\n\nFor a commercial license, see [`LICENSE-COMMERCIAL.md`](./LICENSE-COMMERCIAL.md).\n\n### Cite this project\n\nIf you use EthicalMetrics in research or documentation, please cite it as follows:\n\n\u003e Sandoval, L. (2025). livrasand/EthicalMetrics: v0.1.0-alpha (v0.1.0-alpha). Zenodo. https://doi.org/10.5281/zenodo.16121940\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivrasand%2Fethicalmetrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flivrasand%2Fethicalmetrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivrasand%2Fethicalmetrics/lists"}