How to add the script to your Hugo site

There are several simple ways to integrate Plausible Analytics with your Hugo documentation site. Let's take a look at them:

Option 1 - recommanded setup: Plausible Analytics community plugin#

You'll find included a detailed documentation for using it.

It works for both :

  • Plausible Analytics Cloud version
  • Self-Hosted version.

You can use it as :

  • a simple theme,
  • a hugo module.

And you can choose and manage all the Plausible functions :

  • add custom goals,
  • add outbound link goal,
  • ignore tracking on certain pages,
  • manage CSP rules.
  • eventually write public URL information in Web page source

Plus you can :

  • debug your code
  • avoid bloating your statistics while developping/debugging.

Option 2 - basic setup:#