{"id":20348860,"url":"https://github.com/zgreen/dumb-analytics","last_synced_at":"2025-07-05T14:36:51.422Z","repository":{"id":52496277,"uuid":"133105094","full_name":"zgreen/dumb-analytics","owner":"zgreen","description":"A very simple, open-by-default analytics server, backed by redis.","archived":false,"fork":false,"pushed_at":"2022-12-07T18:15:58.000Z","size":116,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-06T03:40:51.359Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zgreen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-12T01:55:37.000Z","updated_at":"2018-05-15T12:17:11.000Z","dependencies_parsed_at":"2023-01-24T20:15:09.213Z","dependency_job_id":null,"html_url":"https://github.com/zgreen/dumb-analytics","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zgreen/dumb-analytics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zgreen%2Fdumb-analytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zgreen%2Fdumb-analytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zgreen%2Fdumb-analytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zgreen%2Fdumb-analytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zgreen","download_url":"https://codeload.github.com/zgreen/dumb-analytics/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zgreen%2Fdumb-analytics/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263756018,"owners_count":23506486,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-14T22:22:45.634Z","updated_at":"2025-07-05T14:36:51.400Z","avatar_url":"https://github.com/zgreen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dumb-analytics\n\nThis is a simple analytics server, backed by redis. You might use it if:\n\n* you want your analytics to be very simple\n* you want your analytics to be open\n* you distrust, or are wary of, Google's approach to user privacy and data collection\n\n## Install\n\n`npm install dumb-analytics`\n\n## Requirements\n\nThis package requires a redis server to work. The following environment variables must be loaded:\n\n* `ALLOWED_ORIGIN` (this should be the only origin that is allowed to update analytics on your site, e.g. `https://yoursite.cool`)\n* `REDIS_USER`\n* `REDIS_PASSWORD`\n* `REDIS_URL`\n* `REDIS_PORT`\n\n## Usage\n\n### The server\n\nThis example loads environment variables using [dotenv](https://www.npmjs.com/package/dotenv).\n\n```js\n// server.js\nrequire('dotenv').config()\nconst server = require('dumb-analytics')\nserver.listen(3000, () =\u003e console.log('Server listening...'))\n```\n\n### Updating analytics from the client\n\n```js\n// client.js\nfetch(`https://myanalyticssite.cool?url=${window.location.pathname}`)\n```\n\n### View current analytics\n\n`dumb-analytics` serves analytics data from the homepage. This is publicly viewable.\n\nThe shape of the data will be:\n\n```json\n{\n  \"err\": null,\n  \"byDate\": [{ \"total\": 1, \"date\": \"20180511\", \"url\": \"/\" }],\n  \"byUrl\": [{ \"url\": \"/\", \"total\": 1 }],\n  \"total\": 1\n}\n```\n\n* `err` is an error, if any has occured.\n* `byDate` is an array of objects grouped by URL and date.\n* `byURL` is an array of objects with the overall visit total per URL.\n* `total` is the total number of visits to the site.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzgreen%2Fdumb-analytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzgreen%2Fdumb-analytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzgreen%2Fdumb-analytics/lists"}