Skip to content

fix(analytics,static): GA pageviews never sent; public assets 404 via intl rewrite - #332

Merged
ety001 merged 1 commit into
nextfrom
fix/ga-pageview-and-favicons
Sep 3, 2026
Merged

fix(analytics,static): GA pageviews never sent; public assets 404 via intl rewrite#332
ety001 merged 1 commit into
nextfrom
fix/ga-pageview-and-favicons

Conversation

@ety001

@ety001 ety001 commented Sep 3, 2026

Copy link
Copy Markdown
Member

Summary

Three fixes found while verifying the test-env deployment of #331 (GA id present in HTML but zero data in GA; favicon 404s on wallet.steemitdev.com):

1. GA pageviews were never sent

The init config sets send_page_view: false (so our SPA pageview component is the single source of pageviews), but the component re-issued gtag('config', …, {page_path}) — per Google's Measure pageviews docs that does not reliably emit a page_view once the default is disabled. Result: zero pageviews reported. Switched to the documented gtag('event', 'page_view', {page_path, page_title, send_to}).

2. UA-era sample_rate: 5 dropped

Absent from the GA4 config reference — dead code for G- measurement ids.

3. Every nested public/ asset 404'd in production (not just favicons)

  • favicon files lived in app/favicons/ — Next.js only serves public/ (moved; URLs unchanged).
  • Deeper: the middleware matcher intentionally avoids "path contains a dot" (Steem sub-accounts use dots), so static requests reached next-intl and were internally rewritten into /[locale]/… → 404. This broke public/images/** (about-page images) too, since the rewrite shipped. The proxy now passes file-like paths (last-segment static extension) straight through; /@…-rooted account URLs are exempt so account names with dots/extensions keep routing.

Verification

  • tsc / eslint / 646 unit tests (4 new proxy passthrough contract tests) green
  • Production-exact standalone runtime: /favicons/* 200, /images/about/mission.jpg 200, /market 200 with nonce'd gtag, csrf cookie issued, no sample_rate

… intl rewrite

- SPA pageviews used gtag('config', page_path) after send_page_view:false,
  which does not reliably emit a page_view — switch to the documented
  gtag('event', 'page_view') pattern; drop the UA-era sample_rate (absent
  from the GA4 config reference).
- favicons lived in app/favicons (never served); move to public/favicons.
- Static requests reached next-intl and were rewritten into /[locale]/,
  404ing every nested public asset (favicons, images/**): proxy now passes
  file-like paths through before intl; /@-rooted account paths unaffected.
@ety001
ety001 force-pushed the fix/ga-pageview-and-favicons branch from dc81bc7 to a267609 Compare September 3, 2026 18:49
@ety001
ety001 merged commit 6e59bb6 into next Sep 3, 2026
2 of 3 checks passed
@ety001
ety001 deleted the fix/ga-pageview-and-favicons branch September 3, 2026 18:54
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.

1 participant