Adds plausible analytics to your gridsome site.
npm install gridsome-plugin-plausible-analytics
yarn add gridsome-plugin-plausible-analytics
In gridsome.config.js
:
module.exports = {
plugins: [
{
use: 'gridsome-plugin-plausible-analytics',
options: {
dataDomain: 'blog.example.com',
outboundLinkTracking: false
}
}
]
}
- Type:
String
- Default: None, field is required
Domain you entered on plausible.io e.g. blog.example.com.
- Type:
Array[String]
- Default: None
Do not track visits to the listed pages. Should be an array of strings, each representing a page to ignore. e.g. ["/blog4", "/rule/*", "/how-to-*", "/*/admin", "/*/priv/*", "/more-paths-here"]
For more information, check Excluding Pages on Plausible.
- Type:
boolean
- Default:
false
Use Outbound Link Click Tracking. You also need to activate it in your Account. See Step 2 on https://docs.plausible.io/outbound-link-click-tracking#step-2-create-a-custom-event-goal-in-your-plausible-analytics-account.
- Type:
String
- Default: None
Custom domain you set up on plausible.io to serve the js-snippet e.g. stats.[yourdomain].com
(see https://docs.plausible.io/custom-domain)
- Testing Plugin
- Create a new Gridsome project (if you don't want to test with an existing one)
- Open a terminal in your plugin project directory
npm link
oryarn link
- Open a terminal in your Gridsome project
npm link my-plugin-name
oryarn link my-plugin-name
gridsome develop
- After testing:
- First in project:
npm unlink --no-save cowabunga
- Second in plugin:
npm unlink
- First in project: