npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

strapi-analytics

v0.1.5

Published

A simple analytics plugin for Strapi.

Readme

Strapi Analytics

A standalone anonymous analytics plugin for Strapi CMS.

Dashboard screenshot

Getting Started

Note: This plugin is currently in active development and offers a minimal feature set. Expect frequent updates and potential breaking changes as it matures.

Installing Plugin

Run the following command

npm install strapi-analytics

...and paste the following into your plugins.ts file.

...
"strapi-analytics": {
  enabled: true,
},
...

Adding the tracking script to your website

Paste the following snippet into the of your website's HTML layout. This script initializes the global sana tracker asynchronously, meaning it won't impact your site's loading performance.

<!-- Strapi Analytics Plugin -->
<script>
  (function (w, d, s, o, g, r, a, m) {
    w['StrapiAnalyticsObject'] = g;
    ((w[g] =
      w[g] ||
      function () {
        (w[g].q = w[g].q || []).push(arguments);
      }),
      (w[g].l = 1 * new Date()));
    ((a = d.createElement(s)), (m = d.getElementsByTagName(s)[0]));
    a.async = 1;
    a.src = o;
    m.parentNode.insertBefore(a, m);
  })(
    window,
    document,
    'script',
    'https://your-strapi-domain.com/api/strapi-analytics/tracker.js',
    'sana'
  );

  sana('init', 'S-XXXXXXXXXXX'); // replace this with a code generated in your CMS
  sana('pageview');
</script>
<!-- End Strapi Analytics Plugin -->

Tracking functions

Page View

Tracks a standard Page View action (page_view) inside the collection.

sana('pageview', { customMetadataKey: 'value' });

Standard Page View tracks can be also include Strapi

sana(
  'pageview',
  { customMetadataKey: 'value' },
  { uid: 'api::example.example', documentId: 't0nlv95xugj9f9kl8qcu5grz' }
);

Custom actions

Send custom events (e.g., standard action types configured in the schema like click, file_download, form_submit, search, scroll, or custom).

sana('track', 'click', { buttonId: 'signup' });

Granular Content & Document Validation

Link 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.

sana(
  'track',
  'click',
  { campaign: 'summer_sale_2026' }, // Custom metadata
  { uid: 'api::product.product', documentId: 'prod_abc123xyz' } // Strapi Content-Type Details
);

Supported actions

  • page_view
  • click
  • file_download
  • form_submit
  • search
  • scroll
  • custom

Roadmap

  • [x] ~~Add a token/key requirement to track endpoint that prevents unauthorized access.~~
  • [x] ~~Create copy/paste script that can be added to users websites allowing easy interaction with analytics tracking.~~
  • [x] ~~Add content type specific dashboards.~~
  • [x] ~~Make dashboards customisable~~
  • [x] ~~Save dashboard layouts against the user in the database.~~
  • [x] ~~Ensure RBAC is setup and used appropriately.~~
  • [ ] Add drilled down layers that allow for granular tracking - ~~track the CT, the documentId~~, how data in the document is interacted with.
  • [ ] Make the graphs and associated functions more generalised where necessary (in progress)
  • [x] ~~Add more graph types to dashboards.~~
  • [x] ~~Add better time scale adjustments to dashboards.~~
  • [ ] Add export features.
  • [x] ~~npm installation method.~~
  • [ ] Redesign current card types
  • [ ] Make the items that can be added to dashboards work as widgets for use on Strapi homepage

Please feel free to suggest further features for the roadmap.