Skip to content

Fathom: correct page attribution, track production only - #279

Merged
Jan0707 merged 7 commits into
mainfrom
infrastructure-improvements
Oct 20, 2026
Merged

Jan0707 merged 7 commits into
mainfrom
infrastructure-improvements

Conversation

@Jan0707

@Jan0707 Jan0707 commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

The bug

Every client-side navigation was recorded as a page view of the previous page. With canonical: true, our Fathom script reads the path from link[rel=canonical] as soon as the router calls pushState. At that moment, Nuxt has not updated the head yet.

Reproduced in a production build, with every request to the Fathom domain intercepted and answered locally (nothing reached the real analytics):

step actually on page view sent, before after
click → /podcast /podcast / /podcast
click → episode episode /podcast episode
back /podcast episode /podcast
click → /meetup /meetup /podcast /meetup

Departure pings (time on page) carried the same stale path. Entry pages were counted correctly. Every page reached by a click was counted under the previous page's name, and the last page of a session never at all. This has been the case since at least the Nuxt 3 migration (2023-02-10), so per-page numbers for in-site navigation are unreliable for that period. The plan's backlog said "counted twice". That was a departure ping followed by a page view, which is correct behaviour.

The changes

  1. canonical: false. The script reads location, which is already updated when pushState fires. Nothing is lost: every page sets its canonical to its own path, and production serves www.programmier.bar, so the reported hostname is unchanged.
  2. includedDomains: ['www.programmier.bar']. The plugin also loads on Vercel previews and local runs, and there WEBSITE_URL names production. With canonical: true, those visits were reported as production traffic. Without it, they would report under their own hostnames into the same site. Now they send nothing.

Verification

  • Probe in a production build, in both directions:
    • With localhost temporarily allowed, all five steps send the correct path, and the script tag carries data-included-domains.
    • With the final list, the same five steps send nothing.
  • prettier:check clean. lint 0 errors, 156 warnings (unchanged). test 306/306. Ratchet 226. Smoke 18/18.
  • Not verifiable locally: that production still sends. After deploying, the network tab on www.programmier.bar should show one page view per navigation.

Details are in docs/dependency-upgrade-plan.md.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RE7Gq8fzzVAfBahzvcUqTP

Jan0707 and others added 3 commits October 20, 2026 16:31
With canonical: true, the script read the path from the canonical link
when the router called pushState, before Nuxt had updated it. Every
client-side page view, and every departure ping, went to the page the
visitor had just left. Each page sets its canonical to its own path,
so reading location instead loses nothing.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RE7Gq8fzzVAfBahzvcUqTP
The plugin loads on previews and local runs too. With canonical: true
they had reported as production, since WEBSITE_URL names production
there. Without it they would report their own hostnames into the same
site. includedDomains makes the script send nothing elsewhere.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RE7Gq8fzzVAfBahzvcUqTP
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RE7Gq8fzzVAfBahzvcUqTP
Copilot AI balanced review requested due to automatic review settings October 20, 2026 14:31
@vercel

vercel Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
programmierbar-website Ready Ready Preview Oct 20, 2026 2:45pm UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T14:34:25.661654Z 2d09f77 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No blocking issues remain; production tracking should receive the documented post-deployment check.

No open issues 🎉

What changed in this PR

Corrects Fathom page attribution during Nuxt navigation and limits analytics to production.

Changes:

  • Uses the current URL instead of the stale canonical link.
  • Restricts tracking to www.programmier.bar.
  • Documents verification results and historical analytics limitations.
File Description
nuxt-app/​plugins/​fathom.client.ts Disables canonical attribution and restricts tracked domains.
docs/​dependency-upgrade-plan.md Records the diagnosis, verification, and post-deployment check.

Review effort: Balanced

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2d09f77b02

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread nuxt-app/plugins/fathom.client.ts Outdated
Jan0707 and others added 3 commits October 20, 2026 16:43
Explicit rather than derived from WEBSITE_URL, which is set per
environment (localhost in .env.example), so a derived list would track
the local runs it is meant to exclude.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RE7Gq8fzzVAfBahzvcUqTP
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RE7Gq8fzzVAfBahzvcUqTP
Copilot AI balanced review requested due to automatic review settings October 20, 2026 14:44
@Jan0707
Jan0707 merged commit a3fa2f5 into main Oct 20, 2026
6 checks passed
@Jan0707
Jan0707 deleted the infrastructure-improvements branch October 20, 2026 14:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No blocking issues remain in these focused changes; production tracking needs the documented post-deployment check.

No open issues 🎉

Review effort: Balanced

This branch was successfully deployed

1 active deployment
Preview — 050908dc Deployed Oct 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants