Strapi plugin logo for Insights

Insights

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 (via – app 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.

thumbnail for Insights

Logo

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:

1INSIGHTS_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:

FieldDescription
sourceUTM source (e.g., google, facebook, newsletter)
mediumUTM medium (e.g., social, email, cpc)
campaignUTM campaign name
termUTM term (optional, usually for paid keywords)
contentUTM content (optional, for A/B testing or creatives)
pathThe requested URL path
ipVisitor IP address
user_agentBrowser/OS information
viaPlatform (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:

1https://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:

1{
2  "source": "snapchat",
3  "medium": "social",
4  "campaign": "buffer",
5  "term": "summer",
6  "content": "banner",
7  "ip": "192.168.1.1",
8  "user_agent": "Mozilla/5.0 ...",
9  "path": "/page",
10  "via": "app"
11}

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


Reference screenshots

Logo

Logo


Install now

npm install insights-strapi

STATS

No GitHub star yetNot downloaded this week

Last updated

59 days ago

Strapi Version

5.23.6 and above

Author

github profile image for Siddhesh Shetye
Siddhesh Shetye

Useful links

Create your own plugin

Check out the available plugin resources that will help you to develop your plugin or provider and get it listed on the marketplace.