{"_id":"em-analytics-hub","_rev":"3-ef55054e85d0a276921cdb114a51eeff","name":"em-analytics-hub","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"em-analytics-hub","version":"0.1.0","keywords":["emdash","emdash-plugin","analytics","analytics-hub","utm","privacy","portable"],"license":"MIT","_id":"em-analytics-hub@0.1.0","maintainers":[{"name":"facuzarate04","email":"facundo.zarate97@gmail.com"}],"homepage":"https://github.com/facuzarate04/em-analytics-hub#readme","bugs":{"url":"https://github.com/facuzarate04/em-analytics-hub/issues"},"dist":{"shasum":"d083c15bd42431593d1e827d25ec0e6e0bd86493","tarball":"https://registry.npmjs.org/em-analytics-hub/-/em-analytics-hub-0.1.0.tgz","fileCount":141,"integrity":"sha512-5HMLbcJa3FhbHme8tSBbcVagZ1udcnnZNLKCdcRUeHV2jV7uOCm7lNIs2GINl1IGJ/qkCa995URSzaO9XAiWVQ==","signatures":[{"sig":"MEYCIQC+hkUixlPgETGfh7NK/jNz3+R+cvEXceaZ9q6QBYsHZwIhAJxSW0kNpgZvQk7Mg2UZISJ69aypbJEHuQrDzvgKjKVn","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":338333},"type":"module","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./astro":"./dist/astro/BeaconScript.astro","./sandbox":{"types":"./dist/sandbox-entry.d.ts","default":"./dist/sandbox-entry.js"}},"gitHead":"0d52304298709504e7973ba164544124a0ca3930","scripts":{"test":"vitest run","build":"rm -rf dist && tsc && mkdir -p dist/astro && cp -r src/astro/. dist/astro","test:watch":"vitest","prepublishOnly":"npm test && npm run build"},"_npmUser":{"name":"facuzarate04","email":"facundo.zarate97@gmail.com"},"repository":{"url":"git+https://github.com/facuzarate04/em-analytics-hub.git","type":"git"},"_npmVersion":"11.9.0","description":"CMS-aware, portable, privacy-first analytics hub for EmDash. Track pageviews, UTM campaigns, custom events, and more — segmented by route, template, and collection.","directories":{},"_nodeVersion":"24.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"emdash":"^0.1.0","vitest":"^4.1.2","typescript":"^5.7.0"},"peerDependencies":{"emdash":"^0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/em-analytics-hub_0.1.0_1775331765001_0.9196527828308616","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"em-analytics-hub","version":"0.2.0","keywords":["emdash","emdash-plugin","analytics","analytics-hub","utm","privacy","portable"],"license":"MIT","_id":"em-analytics-hub@0.2.0","maintainers":[{"name":"facuzarate04","email":"facundo.zarate97@gmail.com"}],"homepage":"https://github.com/facuzarate04/em-analytics-hub#readme","bugs":{"url":"https://github.com/facuzarate04/em-analytics-hub/issues"},"dist":{"shasum":"e0cec6a93e4fc354d3e448b5dfeb31fa01dafed0","tarball":"https://registry.npmjs.org/em-analytics-hub/-/em-analytics-hub-0.2.0.tgz","fileCount":189,"integrity":"sha512-r04oCq70Ddu2xtM8JrnOabr10dmUejKDnV85kP5Mb9c9SlN+0A8gsEi6rpecRyC6rG19V3zthUfmEnlnxoXEfQ==","signatures":[{"sig":"MEQCIEGImrbF14vfLn4QJ1gGRImXyqVMbOaHnIWd9jI3EQWJAiAa2Dz0Rqw+IJZI92oGw0Bzmy+TcRYyTr4a2AubFl90ig==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":367388},"type":"module","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./astro":"./dist/astro/BeaconScript.astro","./sandbox":{"types":"./dist/sandbox-entry.d.ts","default":"./dist/sandbox-entry.js"}},"gitHead":"a6f6d73c358139e5dd92244951b2910438056a82","scripts":{"test":"vitest run","build":"rm -rf dist && tsc && mkdir -p dist/astro && cp -r src/astro/. dist/astro","test:watch":"vitest","prepublishOnly":"npm test && npm run build"},"_npmUser":{"name":"facuzarate04","email":"facundo.zarate97@gmail.com"},"repository":{"url":"git+https://github.com/facuzarate04/em-analytics-hub.git","type":"git"},"_npmVersion":"11.9.0","description":"CMS-aware, portable, privacy-first analytics hub for EmDash. Track pageviews, UTM campaigns, custom events, and more — segmented by route, template, and collection.","directories":{},"_nodeVersion":"24.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"emdash":"^0.1.0","vitest":"^4.1.2","typescript":"^5.7.0"},"peerDependencies":{"emdash":"^0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/em-analytics-hub_0.2.0_1775440503933_0.12404861269684764","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"em-analytics-hub","version":"0.3.0","description":"CMS-aware, portable, privacy-first analytics hub for EmDash. Track pageviews, UTM campaigns, custom events, and more — segmented by route, template, and collection.","type":"module","license":"MIT","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./sandbox":{"types":"./dist/sandbox-entry.d.ts","default":"./dist/sandbox-entry.js"},"./astro":"./dist/astro/BeaconScript.astro"},"scripts":{"build":"rm -rf dist && tsc && mkdir -p dist/astro && cp -r src/astro/. dist/astro","test":"vitest run","test:watch":"vitest","prepublishOnly":"npm test && npm run build"},"repository":{"type":"git","url":"git+https://github.com/facuzarate04/em-analytics-hub.git"},"homepage":"https://github.com/facuzarate04/em-analytics-hub#readme","bugs":{"url":"https://github.com/facuzarate04/em-analytics-hub/issues"},"publishConfig":{"access":"public"},"engines":{"node":">=18.0.0"},"peerDependencies":{"emdash":"^0.1.0"},"devDependencies":{"emdash":"^0.1.0","typescript":"^5.7.0","vitest":"^4.1.2"},"keywords":["emdash","emdash-plugin","analytics","analytics-hub","utm","privacy","portable"],"gitHead":"4623954a32e892fe66fc9203f2d2a3e4d50893c6","_id":"em-analytics-hub@0.3.0","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-PXLQd4ymeMQ14+239aqkQ7F0hUMwMEIYK2CRp+aOeuXlBU/5ouY2XPowHlJST+AygEMuhiIWOK4yRCpO+854Gw==","shasum":"d5373c5d15c537a4bbdaf6b0925ad3c8bc704e41","tarball":"https://registry.npmjs.org/em-analytics-hub/-/em-analytics-hub-0.3.0.tgz","fileCount":201,"unpackedSize":410367,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC17mBDdqLeYh0+V4rCDsrRh4ly8DuKZMrXTNJRVkj5DgIgBJ81WV3A5BZX6btpMhz9Z+OUfr0V/ekai3o0tmBdtxQ="}]},"_npmUser":{"name":"facuzarate04","email":"facundo.zarate97@gmail.com"},"directories":{},"maintainers":[{"name":"facuzarate04","email":"facundo.zarate97@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/em-analytics-hub_0.3.0_1776542010846_0.5622343768178191"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-04T19:42:44.883Z","modified":"2026-04-18T19:53:31.085Z","0.1.0":"2026-04-04T19:42:45.144Z","0.2.0":"2026-04-06T01:55:04.124Z","0.3.0":"2026-04-18T19:53:30.996Z"},"bugs":{"url":"https://github.com/facuzarate04/em-analytics-hub/issues"},"license":"MIT","homepage":"https://github.com/facuzarate04/em-analytics-hub#readme","keywords":["emdash","emdash-plugin","analytics","analytics-hub","utm","privacy","portable"],"repository":{"type":"git","url":"git+https://github.com/facuzarate04/em-analytics-hub.git"},"description":"CMS-aware, portable, privacy-first analytics hub for EmDash. Track pageviews, UTM campaigns, custom events, and more — segmented by route, template, and collection.","maintainers":[{"name":"facuzarate04","email":"facundo.zarate97@gmail.com"}],"readme":"# em-analytics-hub\n\nCMS-aware, portable, privacy-first analytics for [EmDash](https://github.com/emdash-cms/emdash).\n\nTrack pageviews, UTM campaigns, custom events, funnels, goals, forms analytics, and more — segmented by route, template, and collection. Works on Cloudflare Workers and Node.js self-hosted.\n\n**100% free and open source.** No license keys, no feature gates, no paid tiers.\n\n<p align=\"center\">\n  <img src=\"./docs/screenshots/overview.png\" alt=\"Analytics overview dashboard\" width=\"49%\" />\n  <img src=\"./docs/screenshots/conversion.png\" alt=\"Funnels, goals, and forms analytics\" width=\"49%\" />\n</p>\n\n## Install\n\n```bash\nnpm install em-analytics-hub\n```\n\n```ts\n// astro.config.mjs\nimport emdash from \"emdash/astro\";\nimport { analyticsHub } from \"em-analytics-hub\";\n\nexport default defineConfig({\n  integrations: [\n    emdash({\n      plugins: [analyticsHub()]\n    })\n  ]\n});\n```\n\nAdd the beacon component to your theme layout:\n\n```astro\n---\nimport AnalyticsBeacon from \"em-analytics-hub/astro\";\n---\n\n<AnalyticsBeacon />\n```\n\n## Features\n\n- Dashboard inside EmDash admin\n- Pageviews and unique visitors\n- Top pages with template and collection segmentation\n- Referrer breakdown\n- UTM attribution (source, medium, campaign, term, content)\n- Campaign intelligence with engagement metrics per source\n- Custom events with counts, trends, and property breakdowns\n- Funnels\n- Goals (page, form, event)\n- Forms analytics\n- Countries breakdown\n- Period comparison\n- Configurable data retention (default: 365 days)\n- Works on Cloudflare and Node.js\n\nGoals and funnels can be configured from dedicated admin pages:\n\n- `Analytics`\n- `Goals`\n- `Funnels`\n\n## Complementary Plugins\n\nIf you want a lighter, post-focused analytics experience, pair this plugin with [em-content-insights](https://github.com/facuzarate04/em-content-insights).\n\n- `em-analytics-hub` is the broader analytics layer for campaigns, custom events, funnels, goals, and forms.\n- `em-content-insights` is optimized for editorial and post-level performance inside EmDash.\n- They can coexist in the same EmDash installation when you want both business analytics and content analytics.\n\n## Custom Events\n\nTrack custom events from your theme or pages:\n\n```js\nwindow.emAnalytics.track(\"cta_click\", { variant: \"hero\", page: \"pricing\" });\n```\n\nEvents appear in the dashboard with counts, trend charts, and property breakdowns.\n\n## UTM Tracking\n\nUTM parameters are captured automatically from URLs:\n\n```\nhttps://yoursite.com/blog/post?utm_source=twitter&utm_medium=social&utm_campaign=spring2026\n```\n\nSource, medium, campaign, term, and content are captured automatically and feed the campaign insights shown in the dashboard.\n\n## Template and Collection Metadata\n\nAdd meta tags to your theme layouts to enable template and collection segmentation:\n\n```html\n<meta name=\"em:template\" content=\"blog-post\" />\n<meta name=\"em:collection\" content=\"blog\" />\n```\n\n## Privacy\n\n- No cookies\n- No fingerprinting\n- No localStorage\n- Daily-rotating IP hashes (cannot cross-match visitors across days)\n- Honors Do Not Track (DNT)\n- Bot and crawler filtering\n- Configurable excluded paths and IPs\n\n## Settings\n\n| Setting | Type | Description | Default |\n|---------|------|-------------|---------|\n| Excluded Paths | Plugin setting | Comma-separated path prefixes to skip | `/_emdash/,/admin/` |\n| Excluded IPs | Plugin setting | Comma-separated IPs to filter | Empty |\n| Data Retention | Plugin setting | Days to keep raw events | 365 |\n\n## Support the Project\n\nem-analytics-hub is free and open source. If you find it useful, consider supporting the project:\n\n- Star the repository\n- Report bugs and suggest features\n- Contribute code or documentation\n- [Buy me a coffee](https://buymeacoffee.com/facuzarate)\n\n## License\n\nMIT — see [LICENSE](./LICENSE).\n","readmeFilename":"README.md"}