Skip to main content

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:

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 hugo module (recommended setup)
  • a simple theme

And you can choose and manage all the Plausible functions:

  • add custom goals
  • add outbound link goal
  • manage automatically 404 custom goal
  • ignore tracking on certain pages
  • proxy the script (or use deprecated custom cname)
  • manage CSP rules
  • embed your dashboard with 1 line of code
  • eventually write public URL information in Web page source

Plus you can:

  • debug your code
  • avoid bloating your statistics while developing/debugging

Option 2 - basic setup: