Back to templates

Template details

Nuxt Plausible

Native Plausible Analytics integration for Nuxt with zero-config tracking, composables, and an ad-blocker bypass proxy.

About this template

Nuxt Plausible is a native Nuxt module that integrates Plausible Analytics into Nuxt applications. It requires no configuration out of the box, automatically tracks page views, and exposes composables for manual event and pageview tracking.

What is Nuxt Plausible?

The @nuxtjs/plausible module brings Plausible Analytics to any Nuxt project. It injects the official Plausible tracker into the client (browser) so that page views are reported to a Plausible account, and it provides Vue composables (useTrackEvent and useTrackPageview) for custom event tracking. The module is developed by Johann Schopplich and published under the MIT license, with release activity continuing from 2022 to the present.

Key Features

  • Zero configuration — The module works after adding it to the modules array; it defaults the Plausible domain to window.location.hostname.
  • Automatic event tracking — Outbound link clicks, file downloads (with a customizable list of file extensions), and form submissions can each be tracked automatically by enabling the corresponding option.
  • Composables — useTrackEvent() and useTrackPageview() are auto-imported, client-only helpers for sending custom goals and manually recording page views, including support for revenue properties.
  • Ad-blocker bypass proxy — Set proxy: true to route all Plausible events through your Nitro server at the default /_plausible endpoint, so requests never reach Plausible's domain directly.
  • .env support — Runtime configuration values like NUXT_PUBLIC_PLAUSIBLE_DOMAIN let you change settings without touching the Nuxt config.
  • SSR-ready — The tracker only runs on the client, and composables are safe to call on the server (they become no-ops).
  • Sane defaults — Hostnames matching localhost are ignored by default, and hashMode can be enabled for hash-based routing.

Who is it for?

  • Nuxt developers who want a straightforward analytics integration without manual script setup.
  • Site owners who want to avoid ad blockers suppressing their analytics, by enabling the module's proxy feature.
  • Developers building custom analytics goals who need to track signups, purchases, or downloads through the useTrackEvent composable.

What can you do with Nuxt Plausible?

  • Track custom goals — Call useTrackEvent('signup') to report a goal, optionally passing properties or revenue data (e.g., amount and currency).
  • Manually record page views — Use useTrackPageview({ url: '/virtual-page' }) for single-page-app routing or virtual page paths.
  • Customize tracked file downloads — Pass fileDownloads: { fileExtensions: ['pdf', 'zip', 'csv'] } to limit which file types count as downloads.
  • Proxy Plausible through your own domain — Enable the proxy and set a custom base endpoint if needed.

How does Nuxt Plausible work?

  1. Add the module via npx nuxt module add plausible or by listing '@nuxtjs/plausible' in the modules array of nuxt.config.ts.
  2. The module injects Plausible's script on the client, pulling settings from module options or runtime environment variables.
  3. The tracker sends page view events to https://plausible.io (or your configured apiHost), and, if the proxy is enabled, to your Nitro server first.

screenshot of Nuxt Plausible on template0.com