{"id":22489482,"url":"https://github.com/nuxt-modules/plausible","last_synced_at":"2026-02-25T18:11:56.220Z","repository":{"id":61602351,"uuid":"553044211","full_name":"nuxt-modules/plausible","owner":"nuxt-modules","description":"🎟️ Plausible Analytics integration for Nuxt ","archived":false,"fork":false,"pushed_at":"2026-02-13T22:05:13.000Z","size":2120,"stargazers_count":118,"open_issues_count":2,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-14T01:49:40.476Z","etag":null,"topics":["analytics","nuxt","nuxt-module","nuxt3","plausible","plausible-analytics"],"latest_commit_sha":null,"homepage":"https://plausible.io","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nuxt-modules.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"custom":["https://paypal.me/jschopplich"]}},"created_at":"2022-10-17T16:16:12.000Z","updated_at":"2026-02-13T22:05:15.000Z","dependencies_parsed_at":"2024-08-06T07:37:20.550Z","dependency_job_id":"82e05548-02e9-441e-8f1b-9676b8230691","html_url":"https://github.com/nuxt-modules/plausible","commit_stats":{"total_commits":41,"total_committers":1,"mean_commits":41.0,"dds":0.0,"last_synced_commit":"c8178ea94a6b00c7fa10b125cd9688039debab0f"},"previous_names":["johannschopplich/nuxt-plausible"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/nuxt-modules/plausible","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxt-modules%2Fplausible","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxt-modules%2Fplausible/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxt-modules%2Fplausible/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxt-modules%2Fplausible/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nuxt-modules","download_url":"https://codeload.github.com/nuxt-modules/plausible/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxt-modules%2Fplausible/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29833914,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T17:57:15.019Z","status":"ssl_error","status_checked_at":"2026-02-25T17:56:11.472Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","nuxt","nuxt-module","nuxt3","plausible","plausible-analytics"],"created_at":"2024-12-06T17:19:56.514Z","updated_at":"2026-02-25T18:11:56.208Z","avatar_url":"https://github.com/nuxt-modules.png","language":"TypeScript","funding_links":["https://paypal.me/jschopplich"],"categories":["TypeScript"],"sub_categories":[],"readme":"![Nuxt Plausible module](./.github/og.png)\n\n# Nuxt Plausible\n\n[![npm version](https://img.shields.io/npm/v/@nuxtjs/plausible?color=a1b858\u0026label=)](https://www.npmjs.com/package/@nuxtjs/plausible)\n\nNative integration of [Plausible Analytics](https://plausible.io) for [Nuxt](https://nuxt.com).\n\n## Features\n\n- 🌻 No configuration necessary\n- 📯 Track events and page views manually with [composables](#composables)\n- 📊 Automatic tracking of outbound links, file downloads, and form submissions\n- 🔀 Optional API proxy to avoid ad blockers\n- 📂 [`.env` file support](#configuration)\n- 🧺 Sensible default options\n- 🦾 SSR-ready\n\n## Setup\n\n```bash\nnpx nuxt module add plausible\n```\n\n## Basic Usage\n\nAdd `@nuxtjs/plausible` to the `modules` section of your Nuxt configuration:\n\n```ts\n// `nuxt.config.ts`\nexport default defineNuxtConfig({\n  modules: ['@nuxtjs/plausible'],\n})\n```\n\nDone! Plausible will now run in your application's client.\n\n\u003e [!TIP]\n\u003e By default, `@nuxtjs/plausible` will use `window.location.hostname` for the Plausible `domain` configuration key, which should suit most use cases. If you need to customize the domain, you can do so in the [module options](#module-options).\n\n## Configuration\n\nAll [supported module options](#module-options) can be configured using the `plausible` key in your Nuxt configuration:\n\n```ts\nexport default defineNuxtConfig({\n  modules: ['@nuxtjs/plausible'],\n\n  plausible: {\n    // Prevent tracking on localhost\n    ignoredHostnames: ['localhost'],\n  },\n})\n```\n\n\u003e [!TIP]\n\u003e To allow tracking events on localhost, set the `ignoredHostnames` option to an empty array.\n\n### Runtime Config\n\nAlternatively, leveraging [automatically replaced public runtime config values](https://nuxt.com/docs/api/configuration/nuxt-config#runtimeconfig) by matching environment variables at runtime, set your desired option in your project's `.env` file:\n\n```bash\n# Sets the `plausible.domain` option to `example.com`\nNUXT_PUBLIC_PLAUSIBLE_DOMAIN=example.com\n```\n\nWith this setup, you can omit the `plausible` key in your Nuxt configuration.\n\n### Proxy Configuration\n\nThe module provides a proxy feature that routes Plausible events through your Nitro server instead of sending them directly to Plausible's servers. This is useful to prevent ad blockers from blocking requests to Plausible's domain.\n\nTo enable the proxy, set the `proxy` option to `true`:\n\n```ts\nexport default defineNuxtConfig({\n  modules: ['@nuxtjs/plausible'],\n\n  plausible: {\n    proxy: true,\n  },\n})\n```\n\n\u003e [!NOTE]\n\u003e When enabled, all Plausible events will be sent to your server first, which then forwards them to Plausible's API. The default proxy endpoint is `/_plausible`, but you can customize the path using the `proxyBaseEndpoint` module option.\n\n### Enhanced Tracking\n\nThe module supports automatic tracking of outbound link clicks, file downloads, and form submissions – all powered by the [official Plausible tracker](https://github.com/plausible/analytics/tree/master/tracker).\n\n```ts\nexport default defineNuxtConfig({\n  modules: ['@nuxtjs/plausible'],\n\n  plausible: {\n    autoOutboundTracking: true,\n    fileDownloads: true,\n    formSubmissions: true,\n  },\n})\n```\n\nBy default, file download tracking covers common file types (pdf, xlsx, docx, zip, etc.). You can customize which file extensions are tracked:\n\n```ts\nexport default defineNuxtConfig({\n  modules: ['@nuxtjs/plausible'],\n\n  plausible: {\n    fileDownloads: { fileExtensions: ['pdf', 'zip', 'csv'] },\n  },\n})\n```\n\n\u003e [!NOTE]\n\u003e These features require the corresponding goals to be configured in your [Plausible dashboard](https://plausible.io/docs/custom-event-goals). Outbound link clicks are tracked as `Outbound Link: Click`, file downloads as `File Download`, and form submissions as `Form: Submission`.\n\n## Module Options\n\n| Option                 | Type                                 | Default                      | Description                                                                                                          |\n| ---------------------- | ------------------------------------ | ---------------------------- | -------------------------------------------------------------------------------------------------------------------- |\n| `enabled`              | `boolean`                            | `true`                       | Whether the tracker shall be enabled.                                                                                |\n| `hashMode`             | `boolean`                            | `false`                      | Whether page views shall be tracked when the URL hash changes. Enable this if your Nuxt app uses hash-based routing. |\n| `domain`               | `string`                             | `'window.location.hostname'` | The domain to bind tracking events to.                                                                               |\n| `ignoredHostnames`     | `string[]`                           | `['localhost']`              | Hostnames to ignore when tracking events.                                                                            |\n| `ignoreSubDomains`     | `boolean`                            | `false`                      | Also ignore subdomains of `ignoredHostnames`.                                                                        |\n| `apiHost`              | `string`                             | `'https://plausible.io'`     | The API host where events will be sent to.                                                                           |\n| `autoPageviews`        | `boolean`                            | `true`                       | Track page views automatically. Disable this if you want to manually manage pageview tracking.                       |\n| `autoOutboundTracking` | `boolean`                            | `false`                      | Track outbound link clicks automatically.                                                                            |\n| `fileDownloads`        | `boolean \\| { fileExtensions: string[] }` | `false`                      | Track file downloads automatically. Pass an object to customize tracked file extensions.                             |\n| `formSubmissions`      | `boolean`                            | `false`                      | Track form submissions automatically.                                                                                |\n| `logIgnoredEvents`     | `boolean`                            | `false`                      | Log ignored events to the console.                                                                                   |\n| `proxy`                | `boolean`                            | `false`                      | Proxy the event endpoint through the current origin.                                                                 |\n| `proxyBaseEndpoint`    | `string`                             | `'/_plausible'`              | The base endpoint path for the proxy.                                                                                |\n\n## Composables\n\nAs with other composables in the Nuxt ecosystem, they are auto-imported and can be used in your application's components.\n\n\u003e [!NOTE]\n\u003e Since the Plausible instance is only available on the client, executing the composables on the server will have no effect.\n\n### `useTrackEvent`\n\nTrack a custom event. Track your defined goals by passing the goal's name as the argument `eventName`.\n\n**Type Declarations**\n\n```ts\nfunction useTrackEvent(\n  eventName: string,\n  options?: PlausibleEventOptions,\n): void\n```\n\n**Example**\n\n```ts\n// Tracks the `signup` goal\nuseTrackEvent('signup')\n\n// Tracks the `Download` goal passing a `method` property\nuseTrackEvent('Download', { props: { method: 'HTTP' } })\n\n// Tracks the `Purchase` goal with revenue data\nuseTrackEvent('Purchase', { revenue: { amount: 15.99, currency: 'USD' } })\n```\n\n### `useTrackPageview`\n\nManually track a page view.\n\n**Type Declarations**\n\n```ts\nfunction useTrackPageview(\n  options?: PlausibleEventOptions,\n): void\n```\n\n**Example**\n\n```ts\nuseTrackPageview()\n\n// Track with a custom URL\nuseTrackPageview({ url: '/virtual-page' })\n```\n\n## 💻 Development\n\n1. Clone this repository\n2. Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`\n3. Install dependencies using `pnpm install`\n4. Run `pnpm run dev:prepare`\n5. Start development server using `pnpm run dev`\n\n## License\n\n[MIT](./LICENSE) License © 2022-PRESENT [Johann Schopplich](https://github.com/johannschopplich)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuxt-modules%2Fplausible","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnuxt-modules%2Fplausible","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuxt-modules%2Fplausible/lists"}