Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Fathom Laravel Package

marcreichel/laravel-fathom

A Laravel package for adding privacy-friendly Fathom Analytics to your app. Easily inject the tracking script via a Blade component and track events without compromising user privacy.

Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • The package follows the idiomatic Laravel pattern: a service provider that registers a singleton, a publishable config file, a facade, and a Blade component. This is a low-coupling, opt-in integration — it does not touch the container in surprising ways, does not require a database table, and does not register middleware by default.
  • Two distinct capabilities are bundled, and they should be evaluated separately: (1) the client-side script tag rendered via a Blade component, and (2) the server-side API wrapper for Fathom's Stats API. Teams frequently need only the first; the second is the part with real maintenance surface.
  • Fathom is a cookieless, privacy-first analytics vendor, so the script tag generally avoids consent-banner gating in the EU/UK. That is an architectural and legal-scope benefit, but the TPM should not treat the package as the source of truth on that — it is a vendor property, not a package property.

Integration feasibility

  • Low ceremony: composer require, publish config, set FATHOM_SITE_ID and (optionally) an API token in env. The Blade component is a one-line addition to a layout.
  • The API wrapper authenticates with a Fathom API token and exposes aggregate/site queries. Fit is best when used for internal dashboards or scheduled reporting jobs, not for end-user request paths.

Technical risk

  • Adoption and bus factor are the dominant risks. ~20 stars and a single maintainer means no meaningful community backstop. MIT licensing mitigates this — the code can be vendored or forked into an internal namespace at low cost — but that should be a planned contingency, not a discovery.
  • Repository metadata is unavailable, which is a diligence blocker. Source visibility, CI status, issue responsiveness, and test coverage cannot be confirmed from the listing. Treat as "unverified" until the repo is located and reviewed.
  • Thin-wrapper fragility: the API client is a wrapper over a third-party API. When Fathom versions or changes response shapes, the package lags. Any product surface depending on Fathom data inherits that lag.
  • Client-side blind spots: ad blockers and privacy extensions block Fathom by domain. If undercounting is unacceptable, custom-domain proxying must be supported (or built) — verify this before committing.
  • SPA/Inertia coverage: server-rendered script tags do not fire on client-side route changes. Confirm whether the package exposes a JS hook or data-spa option; if not, you own that glue.
  • CSP: the script must be allowed by script-src and may need a nonce. Confirm the component supports nonce injection or plan to override the view.

Key questions

  1. Does the Blade component support a custom/self-hosted Fathom domain (proxy) and a CSP nonce?
  2. Does the API wrapper cover the endpoints we actually need (aggregate, events, sites, pagination, date ranges), and does it surface rate-limit responses cleanly?
  3. Multi-site / multi-tenant support: one site ID per app, or resolvable per-tenant?
  4. Explicit Laravel and PHP version support matrix, and whether newer Laravel majors are tested in CI.
  5. Test coverage and release cadence — is the 2026-06-11 release a routine bump or a rescue commit?

Integration Approach

Stack fit

  • Standard Laravel app (Blade + optional Livewire) is the happy path: near-zero friction, no infrastructure changes.
  • Inertia/React/Vue or any SPA shell is a partial fit: the initial pageview renders, but subsequent route transitions require manual trackPageview calls. Budget a small front-end task.
  • Fits cleanly into a monolith or a modular monolith. Not a fit for a purely headless/API-only service with no Blade layer — the component is useless there, and only the API client remains.

Migration path

  • From a hand-pasted Fathom snippet: drop-in replacement, one line, plus moving the site ID to env. Low risk; validate rendered HTML in staging.
  • From Google Analytics or another vendor: strictly additive. Dual-run both for 2–4 weeks to establish a baseline delta before decommissioning the incumbent. Expect Fathom numbers to read lower (no cookie-based cross-session stitching); socialize that with stakeholders before the switch so the drop isn't read as a regression.
  • From another Fathom wrapper: config parity exercise; the API client call signatures are the only real work.

Compatibility

  • Verify PHP and Laravel constraints against the app's current version before committing. The main transitive risk is the Guzzle/HTTP-client pin used by the API wrapper — check it doesn't collide with an existing constraint.
  • Fathom API tokens are per-site; plan secret management (Vault/SSM/Doppler) rather than long-lived env values in the deploy config.

Sequencing

  1. Locate and review the repository; confirm license file, tests, CI, and issue history. Gate on this.
  2. Install in staging; publish config; wire site ID and token via secret manager.
  3. Add the Blade component to the base layout; verify rendered markup, CSP compliance, and that events land in the Fathom dashboard.
  4. If SPA/Inertia: add client-side pageview hooks and verify route transitions.
  5. Add custom-domain proxying if ad-blocker undercounting is a material concern.
  6. Only then wire the API client into internal dashboards/reports — behind caching and try/catch, never in a user-facing request path.
  7. Dual-run alongside incumbent analytics, reconcile, then decommission.

Operational Impact

Maintenance

  • Low ongoing effort by volume (small, stable surface), but concentrated effort risk: one maintainer, no formal support contract. Mitigate with a ~ version constraint, a changelog review before each Laravel major upgrade, and a documented "fork-and-vendor" runbook. The MIT license makes that a same-day operation rather than a re-platform.
  • The Blade view is the most likely thing you'll need to override (CSP nonce, custom domain, extra attributes). Plan for a published-view override from day one rather than patching the vendor file.

Support

  • Community-only, via GitHub issues, with ~20 stars implying a small user base — expect to self-serve. Fathom's own commercial support covers the service, not the wrapper; escalate API questions to Fathom, wrapper questions to the maintainer, and be prepared to answer your own.

Scaling

  • Client-side script: effectively zero server cost; load scales with the CDN serving Fathom, not with your app.
  • API client: this is the scaling constraint. Fathom's API is rate-limited; any dashboard that calls it per-request will fail under concurrency or user growth. Mandate a cache layer (5–15 min TTL for aggregates) and move heavy reporting to scheduled jobs writing to a local table. Do not let the API wrapper become a synchronous dependency of a page render.

Failure modes

  • Ad-block undercount (most likely, silent): traffic reads low, no error surfaces. Mitigate with custom-domain proxying; document the known bias.
  • Fathom API outage or rate limit: dashboards calling the API live will error. Mitigate with caching + graceful degradation to last-known values.
  • Misconfigured or missing site ID: silent zero-data. Add a smoke test asserting the script renders with a non-empty site ID in staging.
  • CSP misconfiguration: script silently blocked, no data, errors only in the browser console. Verify in staging with production-equivalent CSP headers — this is the classic "works in staging, dead in prod" trap.
  • Laravel major upgrade: the service provider or facade may break with no upstream fix forthcoming given the maintainer base. Add to the upgrade checklist.
  • Abandonment: low probability of a hard break given the small surface, but no guaranteed patch. Fork is the fallback.

Ramp-up

  • Near-trivial: any Laravel developer integrates the script tag in under an hour and the API client in half a day. The README is the only documentation; assume no examples beyond it.
  • The real ramp-up cost is organizational, not technical: aligning stakeholders on cookieless measurement semantics and the expected delta versus prior tooling, and establishing the caching discipline for API-derived reporting.

TPM recommendation: Green-light for the script-tag use case — small, reversible, MIT-licensed, and easily forked. Treat the API wrapper as conditional: adopt only behind a cache and a scheduled-job boundary, and only after repository due diligence (currently blocked by the missing repo URL) confirms test coverage and recent, non-rescue maintenance. Set a 12-month review point tied to whether the maintainer ships a release compatible with the next Laravel major.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings