Skip to content

fix(analytics): stop duplicate GA4 page_view events - #1295

Merged
tannerlinsley merged 1 commit into
mainfrom
taren/fix-duplicate-ga-pageviews
Sep 24, 2026
Merged

tannerlinsley merged 1 commit into
mainfrom
taren/fix-duplicate-ga-pageviews

Conversation

@tannerlinsley

Copy link
Copy Markdown
Member

The analytics bootstrap could execute twice on one page load, configuring GA4 twice and inserting two loaders. Make initialization run once and send initial and navigation page views only from PageViewTracker, skipping unresolved and repeated paths.

Includes Jonny Hislop's patch and documents that GA4 history-based page measurement must remain disabled. The GA4 admin setting has not been verified.

Validation: pnpm test passed (TypeScript, lint, 525 unit tests passed, 3 skipped). Focused execution checks passed for repeated bootstrap execution, initial page views, repeated effects, navigation, query changes, and return navigation.

@tannerlinsley
tannerlinsley merged commit b7c3ba5 into main Sep 24, 2026
3 of 4 checks passed
@tannerlinsley
tannerlinsley deleted the taren/fix-duplicate-ga-pageviews branch September 24, 2026 19:40
@coderabbitai

coderabbitai Bot commented Sep 24, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: cdc2a9b5-755f-4fcb-b6fa-5ad8fd8a883a

📥 Commits

Reviewing files that changed from the base of the PR and between f180ac2 and 9efecc5.

📒 Files selected for processing (2)
  • .agents/analytics.md
  • src/routes/__root.tsx
 _________________________________________________________________
< This is Sparta! And I'm here to kick bugs into the pit of doom. >
 -----------------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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