1
0
Fork
You've already forked material-plausible-plugin
0
Plausible Analytics integration for Material for MkDocs https://material-plausible-plugin.ale.sh/
  • HTML 84.1%
  • Python 15.9%
Find a file
2025年03月17日 15:58:08 +07:00
docs Document the search term tracking 2023年02月17日 19:54:08 +03:00
material_plausible chore: switch to Poetry, bump to 0.3.0 2025年03月17日 15:58:08 +07:00
tests Initial commit 2023年01月11日 19:37:34 +06:00
.editorconfig Initial commit 2023年01月11日 19:37:34 +06:00
.gitignore Remove __pycache__ 2023年02月17日 19:33:23 +03:00
LICENSE.txt Initial commit 2023年01月11日 19:37:34 +06:00
mkdocs.yml Add search tracking integration 2023年02月17日 19:33:41 +03:00
poetry.lock chore: switch to Poetry, bump to 0.3.0 2025年03月17日 15:58:08 +07:00
poetry.toml chore: switch to Poetry, bump to 0.3.0 2025年03月17日 15:58:08 +07:00
pyproject.toml chore: switch to Poetry, bump to 0.3.0 2025年03月17日 15:58:08 +07:00
README.md feature: allow specifying api endpoint 2025年03月17日 15:56:50 +07:00

Plausible Analytics for Material

Plausible Analytics is a simple, open-source, lightweight and privacy-friendly web analytics alternative to Google Analytics.

This plugin implements Plausible Analytics support in Material for MkDocs.

Live demo

Quick start

  1. Install the plugin:

    pip install material-plausible-plugin
    
  2. Add the following lines to mkdocs.yml:

    plugins:- material-plausibleextra:analytics:provider:plausibledomain:example.com#: If using custom domain proxy or self-hosting Plausible,#: uncomment and specify script path here:# src: "https://plausible.example.com/js/plausible.js"#: If you’re using the privacy plugin or hosting the script#: on another domain, uncomment and specify API path here:# api: "https://plausible.example.com/api/event"

Feedback widget

To enable the feedback widget, add the following lines inside the extra.analytics block:

feedback:title:Was this page helpful?ratings:- icon:material/emoticon-happy-outlinename:This page was helpfuldata:goodnote:>- Thanks for your feedback!- icon:material/emoticon-sad-outlinename:This page could be improveddata:badnote:>- Thanks for your feedback! Help us improve this page by
 using our <a href="..." target="_blank" rel="noopener">feedback form</a>.

Then in your Plausible account, go to your website's settings and visit the Goals section. For each rating defined, click on the + Add goal button, select Custom event as the goal trigger and enter Feedback: {rating data value}.

For example, if you have two ratings – good and bad, add Feedback: good and Feedback: bad goals.

Ratings will be shown in the Goal Conversions section at the very bottom of the page, as soon as any are available:

image

You can click on a specific "goal" to filter your dashboard by it. For example, if you filter by the Feedback: bad goal, you can see which pages need the most attention in the Top Pages section.

You can track site search usage, too. Enable the search plugin, then in the Goals section, set up a goal named Search. On your statistics page, you can click it in the goals list to see what terms your users are searching for:

image

License

material-plausible-plugin is distributed under the terms of the ISC license.