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

jeffersongoncalves/laravel-fathom

A Laravel package for integrating Fathom Analytics into your application. Configure your Fathom site ID, inject the privacy-friendly tracking script, and start collecting lightweight, cookie-free analytics with minimal setup. Ideal for developers who want simple, privacy-focused website stats withou...

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • Still a presentation-layer wrapper: a service provider (auto-discovered), a publishable config file, and a Blade directive or component that emits Fathom's client-side <script> tag. No models, migrations, routes, queues, or container bindings.
  • 4.1.0 does not change the shape — it adds an attribute to the emitted tag. The package reads Laravel's Vite CSP nonce (the value set via Vite::useCspNonce()) and stamps it onto every script it renders.
  • Architectural value remains thin: Fathom's canonical embed is ~4 lines of HTML. The package's contribution is config plumbing, environment gating, a reusable directive, and now nonce propagation. Treat it as sugar, not infrastructure — but the nonce handling is the first piece of genuine (if small) logic rather than pure templating.

Integration feasibility

  • Install path unchanged: composer require, publish config, set FATHOM_SITE_ID, add the directive to the base layout. 15–30 minutes including verification.
  • 4.1.0 removes the previous friction point for CSP-hardened apps. Nonce-based script-src no longer requires 'unsafe-inline' or a hand-rolled snippet wrapper — this is the single most common reason teams abandon analytics packages in a strict-CSP environment.
  • Important caveat to verify in source: the feature is described as carrying Laravel's Vite CSP nonce, which implies a dependency on Vite::useCspNonce() being called during the request. Applications that generate nonces through middleware and inject them into Blade manually (common with laravel-security-headers or bespoke middleware that does not route through Vite) may not be covered. Confirm whether the package reads Vite::cspNonce() directly, checks app('csp-nonce'), or supports an explicit config override.
  • Still unconfirmed and still decisive: custom tracker domain support (CNAME on cdn.usefathom.com). Fathom's main operational differentiator against ad-blockers. If the package hardcodes the default CDN host, it forfeits the primary reason to pay for Fathom — and 4.1.0 does nothing here.
  • Also still open: async/defer emission, environment/path allowlists, directive vs. anonymous component, and whether the snippet matches Fathom's current v3 data-site format.

Technical risk

  • Maintainer/abandonment risk — high, marginally softened. 4.1.0 is a responsive, scope-appropriate change that directly addresses a real integration blocker, which is a better signal than the previous data suggested. But one release does not establish a maintenance pattern; 2 stars and 0 dependents still mean no community scrutiny and no bus factor.
  • Supply-chain exposure — moderate. The provider executes at framework boot with full application privileges. 4.1.0 adds nonce-reading logic that touches Laravel internals (Vite facade / container), which is a slightly wider surface than pure templating. A full read of the codebase remains mandatory and should still take under 20 minutes.
  • Silent-failure risk — high. Analytics snippets fail without error. 4.1.0 mitigates one specific silent failure (CSP block) but does not change the general property: a stale snippet format, missing site ID, or ad-blocker interception still produces zero data with zero exceptions.
  • Version drift — moderate. If Fathom changes its embed, a low-traffic wrapper may not be patched promptly. Nonce logic also couples the package to Laravel's Vite internals, which can shift between major versions.
  • New, small risk: nonce handling can regress silently — a nonce that fails to resolve could emit nonce="", which some browsers treat as a mismatch and block. Verify the exact attribute output in a CSP-enabled staging environment rather than assuming it degrades gracefully.

Key questions

  1. Does it support a custom tracker domain, configurable per environment?
  2. Is there an environment/path allowlist (exclude local, staging, /admin, /telescope)?
  3. Does it emit async/defer?
  4. Does it support a CSP nonce? Answered in 4.1.0: yes, when the app sets a Vite nonce. Follow-up: does it support non-Vite nonce sources, and what is emitted when no nonce is set?
  5. Are goal/event tracking (fathom.trackGoal) and SPA route-change hooks exposed, or only the pageview snippet?
  6. What are the Laravel/PHP constraints, and is there any CI or test suite — particularly for the nonce path?
  7. Is the Blade namespace collision-safe against existing components?

Integration Approach

Stack fit

  • Suitable for any Blade-rendered Laravel application, including Livewire and Inertia roots. 4.1.0 makes it materially more suitable for teams running strict CSP with Vite-generated nonces — a meaningful expansion of the addressable case.
  • Still not applicable to decoupled front-ends (Next/Nuxt/Vue SPA); the nonce feature assumes Laravel renders the tag.

Migration path

  • Two entry points: greenfield, or replacing a hand-rolled inline snippet. Both additive and reversible in one commit.
  • New for CSP-hardened apps: if you currently carry a bespoke snippet wrapper solely to thread a nonce, 4.1.0 is a legitimate reason to replace it with this package. That is the strongest adoption case the package has had.
  • Exit cost remains near zero: replace the directive with the raw snippet. Budget for vendoring — copy the directive into resources/views/components under your own namespace if the package stalls. Still the correct default posture at this adoption level.

Compatibility

  • Pin an exact version (4.1.0) in the lockfile; do not float given the maintainer profile.
  • Validate against the actual CSP policy: confirm the emitted nonce attribute matches the header value in a real response, and confirm the script appears in script-src (or script-src-elem). Test with Content-Security-Policy-Report-Only first so a mismatch surfaces as a report rather than a blocked script.
  • Confirm the nonce source. If your app sets nonces outside Vite, treat 4.1.0 as unverified for your case until tested.
  • Ensure no duplicate tag: leftover inline snippets will double-count pageviews and corrupt historical data.
  • Confirm consent/disclosure posture with legal; Fathom is cookieless but requirements vary by jurisdiction.

Sequencing

  1. Source audit and composer constraint review, including the nonce implementation (½ day).
  2. Install in staging with a staging site ID; confirm the network request and a live visitor in the Fathom dashboard.
  3. New: verify nonce propagation under the real CSP header — check the rendered attribute, the browser console for script-src violations, and a CSP report-only endpoint. Regression-test the no-nonce path (local/dev, where Vite may not be running).
  4. Add environment gates and path exclusions; verify the production build excludes staging traffic.
  5. Deploy to production behind a single PR; confirm the realtime dashboard within one session.
  6. Only then evaluate goal/event tracking as a separate scope decision.

Operational Impact

Maintenance

  • Ongoing cost remains a few hours per year. The nonce feature adds one thing to re-verify on every Laravel major upgrade: the package's coupling to Vite's nonce API. Add that to the quarterly review checklist alongside upstream activity.
  • Ownership still matters more than effort: assign a named owner (platform/frontend) and a standing quarterly review. If the package is unmaintained at that review, vendor and move on.

Support

  • No commercial support, no meaningful community. Escalation path is the Fathom documentation and the raw snippet. Still acceptable precisely because the fallback is trivial — and now slightly more so, since the nonce logic is a handful of lines you can copy.

Scaling

  • No server-side scaling implications; client-side script, Fathom is SaaS. Cost scales with pageview volume on your Fathom plan. No response-time impact if async is used.

Failure modes

  • Missing/blank site ID → silent no-data.
  • Ad-blocker interception on the default CDN → undercounted traffic (mitigate with custom domain).
  • CSP violation → console errors, no data. Substantially mitigated in 4.1.0 when a Vite nonce is present; still live for apps with non-Vite nonces or no nonce and a strict policy.
  • Nonce mismatch or empty nonce="" → script blocked despite correct configuration intent; verify explicitly rather than assuming.
  • Render-blocking if not async → measurable LCP regression; verify with Lighthouse.
  • Environment leakage → staging/local traffic polluting production dashboards.
  • Duplicate snippets → double-counted pageviews, unrecoverable without a data reset.

Ramp-up

  • Any Laravel developer is productive in under 30 minutes; no new mental model. The nonce feature requires no additional knowledge from developers already using Vite CSP nonces, but does require whoever owns CSP to validate the integration once.
  • Recommendation: unchanged in direction, improved in confidence. Adopt as a convenience wrapper with a pinned version and a vendored fallback plan — 4.1.0 (nonce support) is a genuine reason to prefer it over an inline snippet for CSP-strict apps, whereas previously there was little to justify the dependency. For non-CSP apps, inlining the snippet remains equally defensible. 4.1.0 narrows the gap but does not clear the bar for treating this as durable infrastructure.
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.
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels
wazza/laravel-db-encryption
hokny/laravel-generator
vonsogt/backup
jengo/queues
jeremykenedy/laravel-observability
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums