{"id":14964306,"url":"https://github.com/lostdesign/nuxt-fathom","last_synced_at":"2025-08-20T04:17:05.780Z","repository":{"id":65522492,"uuid":"471673058","full_name":"lostdesign/nuxt-fathom","owner":"lostdesign","description":"This package is a nuxt 2 wrapper around derrickreimer/fathom-client to be able to use usefathom.com in all its glory. Thanks to @derrickreimer for this framework agnostic library ❤️‍🔥.","archived":false,"fork":false,"pushed_at":"2022-04-24T13:53:38.000Z","size":538,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-30T00:43:57.301Z","etag":null,"topics":["fathom-client","nuxt","nuxt2","usefathom"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/lostdesign.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["lostdesign"]}},"created_at":"2022-03-19T11:17:45.000Z","updated_at":"2023-05-27T17:31:58.000Z","dependencies_parsed_at":"2023-01-27T06:00:51.083Z","dependency_job_id":null,"html_url":"https://github.com/lostdesign/nuxt-fathom","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostdesign%2Fnuxt-fathom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostdesign%2Fnuxt-fathom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostdesign%2Fnuxt-fathom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lostdesign%2Fnuxt-fathom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lostdesign","download_url":"https://codeload.github.com/lostdesign/nuxt-fathom/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238085255,"owners_count":19413993,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["fathom-client","nuxt","nuxt2","usefathom"],"created_at":"2024-09-24T13:32:57.821Z","updated_at":"2025-02-10T08:32:07.461Z","avatar_url":"https://github.com/lostdesign.png","language":"JavaScript","funding_links":["https://github.com/sponsors/lostdesign"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"repo banner\" src=\"media/banner.png\"\u003e\n\u003c/p\u003e\n\nThis package is a nuxt 2 wrapper around [derrickreimer/fathom-client](https://github.com/derrickreimer/fathom-client) to be able to use [usefathom.com](https://usefathom.com) in all its glory. Thanks to @derrickreimer for this framework agnostic library ❤️‍🔥.\n\n## 🔧 Installation\n#### 1. Install the following packages:\n```\nnpm i fathom-client\nnpm i @lostdesign/nuxt-fathom\n```\n\n#### 2. Register the module inside `nuxt.config.js`\n```js\nexport default {\n  ...\n  modules: ['@lostdesign/nuxt-fathom']\n  ...\n}\n```\n\n#### 3. Configure the module inside `nuxt.config.js`\n```js\nexport default {\n  ...\n  fathom: {\n    namespace: 'fathom', // optional\n    spa: 'history', // recommended\n    siteId: 'YOUR-SITE-ID-FROM-FATHOM',\n    url: 'https://custom.fathom.domain.com/script.js'\n    honorDNT: false,\n    includedDomains: [\n      'replace-with-your-domain.com',\n      'localhost:3000',\n      'uselinked.com'\n    ],\n    excludedDomains: [\n      'google.com'\n    ],\n    canonical: true,\n  },\n  ...\n}\n```\n\n\n| Property | Type | Required | Description |\n| ------------- | ------------- | ------------- | ------------- |\n| `siteId` | string | `mandatory` | The site id as given by fathom, find yours in your [usefathom settings](https://app.usefathom.com/#/settings/sites). |\n| `spa` | string | `mandatory` | Accepts one of the following values: `auto`, `history`, or `hash` (see [advanced docs](https://usefathom.com/support/tracking-advanced)). |\n| `includedDomains` | array | `optional` | Only tracks when on one of these domains. |\n| `excludedDomains` | array | `optional` | Only tracks when NOT on one of these domains. |\n| `url` | string | `optional` | The URL of the tracking script (defaults to `https://cdn.usefathom.com/script.js`). If you're using a [custom domain](https://usefathom.com/support/custom-domains) then you should change this parameter to use it (example `https://parrot.yourwebsite.com/script.js`). |\n| `honorDNT` | boolean | `optional` | When `true`, honors the [DNT header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/DNT) in the visitor's browser |\n| `canonical` | boolean | `optional` | When `false`, ignores the canonical tag if present (defaults to `true`). |\n| `namespace` | string | `optional` | Optional value to overwrite the default namespace of fathom. Default is `fathom` which means you will be able to use `this.$fathom.trackPageview()`. |\n\n#### 4. Optional: Register global trackPageview middleware inside `nuxt.config.js`\nEvery pageview will be *automatically tracked* if you register this middleware. Without you are **required** to call `this.$fathom.trackPageview()` yourself, most likely inside a custom page middleware.\n```js\nexport default {\n  ...\n  router: {\n    middleware: ['fathom']\n  }\n  ...\n}\n```\n\n## 📚 Usage\n#### `this.$fathom.trackPageview(opts?: object)`\n\nTracks a pageview.\n\n##### Arguments\n\n- `opts` - An Object of options:\n  - `url` - When set, overrides `window.location`.\n  - `referrer` - When set, overrides `document.referrer`.\n\n\n#### `this.$fathom.trackGoal(code: string, cents: number)`\n\nTracks a goal.\n\n##### Arguments\n\n- `code` - the code provided in the Fathom UI.\n- `cents` - the value of the goal conversion.\n\n\n#### `this.$fathom.enableTrackingForMe()`\n\nEnables tracking for the current visitor.\n\nSee https://usefathom.com/docs/features/exclude.\n\n\n#### `this.$fathom.blockTrackingForMe()`\n\nBlocks tracking for the current visitor.\n\nSee https://usefathom.com/docs/features/exclude.\n\n\n#### `this.$fathom.setSite(id: string)`\n\nSets the site ID for tracking (overrides the ID used when loading Fathom).\n\n##### Arguments\n\n- `id` - The site ID provided in the Fathom UI.\n\nSee [advanced options for tracking](https://usefathom.com/support/tracking-advanced).\n\n\n# 💖 Sponsor\n\nIf you enjoy the this package, please consider [becoming a sponsor or leave a tip](https://github.com/sponsors/lostdesign) or use my referral link for [https://usefathom.com/ref/MQYHPK](https://usefathom.com/ref/MQYHPK) when signing up for fathom ❤️‍🔥.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flostdesign%2Fnuxt-fathom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flostdesign%2Fnuxt-fathom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flostdesign%2Fnuxt-fathom/lists"}