sanity-plugin-plausible-analytics
v2.0.1
Published
Access your plausible analytics in sanity studio.
Maintainers
Readme
sanity-plugin-plausible-analytics
Inspired by https://www.sanity.io/plugins/plausible-iframe for v2.

Compatibility
| sanity-plugin-plausible-analytics | Sanity | React |
| ----------------------------------- | -------------------- | -------------- |
| ^2.0.0 | ^5.0.0 \|\| ^6.0.0 | ^19.2 |
| ^1.0.0 | ^3.0.0 \|\| ^4.0.0 | ^18 \|\| ^19 |
See the changelog for details on what changed in 2.0.0.
Plausible configuration
- Create a shared link without password protection.
- Add the shared link to the plugin configuration.
Installation
pnpm install sanity-plugin-plausible-analyticsUsage
Add it as a plugin inside the dashboardTool in sanity.config.ts (or .js):
import {defineConfig} from 'sanity'
import {dashboardTool} from '@sanity/dashboard'
import {plausibleWidget} from 'sanity-plugin-plausible-analytics'
export default defineConfig({
//...
plugins: [
dashboardTool({
widgets: [
plausibleWidget({
url: 'https://plausible.io/share/your-project?auth=xxxx',
}),
],
}),
],
})Options
url- Required - the shared link from plausibletitle- Optional - defaults to 'Plausible Analytics'height- Optional - defaults to 'calc(100vh - 143px)'
License
MIT © Stijn
Develop & test
This plugin uses @sanity/plugin-kit with default configuration for build & watch scripts.
See Testing a plugin in Sanity Studio on how to run this plugin with hotreload in the studio.
