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

insights-strapi

v0.0.9

Published

A Strapi plugin to capture visitor insights such as source, medium, campaign, path, IP, user agent, and platform (app/website).

Readme

Insights

A Strapi plugin to capture visitor insights such as source, medium, campaign, path, IP, user agent, and platform (app/website).


Table of Contents


Description

Insights is a Strapi plugin that automatically logs visitor requests and analytics. It captures:

  • UTM parameters (source, medium, campaign, term, content)
  • Path of the request
  • IP address
  • User agent
  • Platform (viaapp or website)

The plugin ignores Strapi admin routes by default, so it only tracks public-facing API requests.

This plugin is useful for monitoring traffic, marketing campaigns, or building custom analytics dashboards.


How to Install

Copy the following code and run from your terminal:

yarn add insights-strapi

or

npm i insights-strapi

After installation, rebuild Strapi:

npm run build
npm run develop

Usage

The plugin automatically tracks requests when configured. You do not need to manually call any API. Every request to your frontend APIs will be logged in the plugin's content-type (Insights).


Environment Variable

To enable/disable the plugin globally, add this to your .env file:

INSIGHTS_ENABLED=true
  • INSIGHTS_ENABLED=true → Insights tracking is enabled (default behavior).
  • INSIGHTS_ENABLED=false → Insights tracking is disabled (no requests will be logged).

Captured Parameters

The plugin tracks the following fields in the insight collection type:

| Field | Description | |------------|--------------------------------------------------------| | source | UTM source (e.g., google, facebook, newsletter) | | medium | UTM medium (e.g., social, email, cpc) | | campaign | UTM campaign name | | term | UTM term (optional, usually for paid keywords) | | content | UTM content (optional, for A/B testing or creatives) | | path | The requested URL path | | ip | Visitor IP address | | user_agent | Browser/OS information | | via | Platform (app or website) |


Ignore Admin Routes

By default, the plugin ignores:

  • /admin
  • /content-manager
  • /users-permissions

You can extend or customize the ignore list in the middleware code if needed.


Example Frontend Request with UTM Parameters

When a user visits a URL with UTM parameters:

https://www.example.com/page?source=snapchat&medium=social&campaign=buffer&term=summer&content=banner&via=app

The plugin will automatically log the following in the Strapi Insights collection:

{
  "source": "snapchat",
  "medium": "social",
  "campaign": "buffer",
  "term": "summer",
  "content": "banner",
  "ip": "192.168.1.1",
  "user_agent": "Mozilla/5.0 ...",
  "path": "/page",
  "via": "app"
}

This allows you to track campaign performance, user activity, and platform usage effortlessly.


Reference screenshots