{"id":51409712,"url":"https://github.com/acol248/strapi-analytics","last_synced_at":"2026-07-04T14:02:39.316Z","repository":{"id":365343561,"uuid":"1263329082","full_name":"acol248/strapi-analytics","owner":"acol248","description":"Strapi analytics plugin for lightweight, self-hosted event tracking and native database document validation.","archived":false,"fork":false,"pushed_at":"2026-06-29T22:55:50.000Z","size":1554,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-30T00:12:36.953Z","etag":null,"topics":["analytics","event-tracking","javascript","privacy-focused","self-hosted","strapi","strapi-cms","strapi-plugin","strapi-v5","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/acol248.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-08T21:10:21.000Z","updated_at":"2026-06-29T22:55:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/acol248/strapi-analytics","commit_stats":null,"previous_names":["acol248/strapi-analytics"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/acol248/strapi-analytics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acol248%2Fstrapi-analytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acol248%2Fstrapi-analytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acol248%2Fstrapi-analytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acol248%2Fstrapi-analytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acol248","download_url":"https://codeload.github.com/acol248/strapi-analytics/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acol248%2Fstrapi-analytics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35124130,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-04T02:00:05.987Z","response_time":113,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["analytics","event-tracking","javascript","privacy-focused","self-hosted","strapi","strapi-cms","strapi-plugin","strapi-v5","typescript"],"created_at":"2026-07-04T14:02:38.807Z","updated_at":"2026-07-04T14:02:39.307Z","avatar_url":"https://github.com/acol248.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Strapi Analytics\n\nA standalone anonymous analytics plugin for Strapi CMS.\n\n![Dashboard screenshot](./screenshots/screenshot-3.jpg)\n\n## Getting Started\n\n\u003e Note: This plugin is currently in active development and offers a minimal feature set. Expect frequent updates and potential breaking changes as it matures.\n\n### Installing Plugin\n\nRun the following command\n\n```bash\nnpm install strapi-analytics\n```\n\n...and paste the following into your `plugins.ts` file.\n\n```\n...\n\"strapi-analytics\": {\n  enabled: true,\n},\n...\n```\n\n### Adding the tracking script to your website\n\nPaste the following snippet into the \u003chead\u003e of your website's HTML layout. This script initializes the global sana tracker asynchronously, meaning it won't impact your site's loading performance.\n\n```html\n\u003c!-- Strapi Analytics Plugin --\u003e\n\u003cscript\u003e\n  (function (w, d, s, o, g, r, a, m) {\n    w['StrapiAnalyticsObject'] = g;\n    ((w[g] =\n      w[g] ||\n      function () {\n        (w[g].q = w[g].q || []).push(arguments);\n      }),\n      (w[g].l = 1 * new Date()));\n    ((a = d.createElement(s)), (m = d.getElementsByTagName(s)[0]));\n    a.async = 1;\n    a.src = o;\n    m.parentNode.insertBefore(a, m);\n  })(\n    window,\n    document,\n    'script',\n    'https://your-strapi-domain.com/api/strapi-analytics/tracker.js',\n    'sana'\n  );\n\n  sana('init', 'S-XXXXXXXXXXX'); // replace this with a code generated in your CMS\n  sana('pageview');\n\u003c/script\u003e\n\u003c!-- End Strapi Analytics Plugin --\u003e\n```\n\n### Tracking functions\n\n#### Page View\n\nTracks a standard Page View action (page_view) inside the collection.\n\n```js\nsana('pageview', { customMetadataKey: 'value' });\n```\n\nStandard Page View tracks can be also include Strapi\n\n```js\nsana(\n  'pageview',\n  { customMetadataKey: 'value' },\n  { uid: 'api::example.example', documentId: 't0nlv95xugj9f9kl8qcu5grz' }\n);\n```\n\n#### Custom actions\n\nSend custom events (e.g., standard action types configured in the schema like click, file_download, form_submit, search, scroll, or custom).\n\n```js\nsana('track', 'click', { buttonId: 'signup' });\n```\n\n#### Granular Content \u0026 Document Validation\n\nLink specific actions directly to models and existing documents in your database. The API automatically validates that both the model and the specified document exist. This prevents data injection errors and enforces schema integrity.\n\n```js\nsana(\n  'track',\n  'click',\n  { campaign: 'summer_sale_2026' }, // Custom metadata\n  { uid: 'api::product.product', documentId: 'prod_abc123xyz' } // Strapi Content-Type Details\n);\n```\n\n### Supported actions\n\n- page_view\n- click\n- file_download\n- form_submit\n- search\n- scroll\n- custom\n\n## Roadmap\n\n- [x] ~~Add a token/key requirement to track endpoint that prevents unauthorized access.~~\n- [x] ~~Create copy/paste script that can be added to users websites allowing easy interaction with analytics tracking.~~\n- [x] ~~Add content type specific dashboards.~~\n- [x] ~~Make dashboards customisable~~\n- [x] ~~Save dashboard layouts against the user in the database.~~\n- [x] ~~Ensure RBAC is setup and used appropriately.~~\n- [ ] Add drilled down layers that allow for granular tracking - ~~track the CT, the documentId~~, how data in the document is interacted with.\n- [ ] Make the graphs and associated functions more generalised where necessary (in progress)\n- [x] ~~Add more graph types to dashboards.~~\n- [x] ~~Add better time scale adjustments to dashboards.~~\n- [ ] Add export features.\n- [x] ~~npm installation method.~~\n- [ ] Redesign current card types\n- [ ] Make the items that can be added to dashboards work as widgets for use on Strapi homepage\n\nPlease feel free to suggest further features for the roadmap.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facol248%2Fstrapi-analytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facol248%2Fstrapi-analytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facol248%2Fstrapi-analytics/lists"}