@lizarzaburu/strapi-plugin-umami-analytics
v1.3.0
Published
Strapi plugin to display Umami analytics in admin panel with permission-based access control and automatic CSP configuration
Downloads
19
Maintainers
Readme
Umami Analytics Plugin
A Strapi plugin that displays Umami analytics in the admin panel with role-based access control.
Features
- 🔒 Permission-based access control
- 📊 Embeds Umami share URL directly in admin panel
- 🌐 Multilingual (English/German)
- ⚡ Strapi 5 compatible
- 🛡️ Automatic Content Security Policy (CSP) configuration
Installation
npm install @lizarzaburu/strapi-plugin-umami-analyticsSetup
1. Get your Umami Share URL
- Log into your Umami dashboard
- Go to your website's analytics
- Click "Share" button
- Copy the share URL
2. Configure Plugin
Configure the plugin in config/plugins.ts:
export default ({ env }) => ({
// ... other plugins
'umami-analytics': {
enabled: true,
config: {
umamiUrl: env('UMAMI_URL'),
},
},
});3. Add Environment Variable
Add your Umami share URL to .env:
UMAMI_URL=https://umami.yourdomain.com/share/xxxxxxxx/website-nameNote: The plugin automatically configures Content Security Policy (CSP) headers to allow the Umami iframe. No manual middleware configuration needed!
4. Set Permissions
- Go to Settings → Roles in Strapi admin
- Select a role (e.g., "Super Admin")
- Under Plugins → Umami Analytics, enable "Access Analytics"
- Save
5. View Analytics
The "Analytics" menu item will appear in the sidebar for users with the permission.
Configuration Options
You can also set the URL directly in the config without using an environment variable:
'umami-analytics': {
enabled: true,
config: {
umamiUrl: 'https://umami.yourdomain.com/share/xxxxxxxx/website-name',
},
},Support
For issues, questions, or contributions, please visit the GitHub repository.
License
MIT License - see LICENSE file for details.
