feat(web): track Segment client navigations (fixes NV-8755) - #178
Merged
Conversation
Drop the production Segment snippet, write key, CSP allowlist, and Playwright third-party blocklist entries. Mixpanel remains the website page-visit source. Fixes NV-8755 Co-authored-by: Dima Grossman <dima@grossman.io>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
scopsy
marked this pull request as ready for review
September 1, 2026 13:51
Restore Segment as the website page analytics source and report App Router pathname changes without duplicating the initial page call. Remove Mixpanel page tracking while retaining the SDK. Fixes NV-8755 Co-authored-by: Dima Grossman <dima@grossman.io>
…-analytics-46f9 Co-authored-by: Dima Grossman <dima@grossman.io>
Co-authored-by: Dima Grossman <dima@grossman.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Keeps Segment as the website page analytics source and adds page calls for Next.js App Router navigations. The existing Segment snippet owns the initial page call; the client tracker reports subsequent pathname changes.
A window-level last-path marker avoids duplicate calls on initial mount and still works when navigation remounts a route-group layout.
Mixpanel's custom
Market Page Visittracker is removed. The Mixpanel SDK and package remain available for other events.Changes
SegmentPageTrackingusingusePathname()analytics.page()callMixpanelTracking/Market Page VisitThe Segment write key, script, CSP domains, and test network allowlist stay in place. GTM, LinkedIn Insight, and Plausible are unchanged.
Linear: NV-8755
Validation
pnpm lint(0 errors; 5 existing<img>warnings)pnpm typecheckgit diff --checkSlack Thread