Skip to content

feat(web): track Segment client navigations (fixes NV-8755) - #178

Merged
scopsy merged 4 commits into
mainfrom
cursor/remove-segment-analytics-46f9
Sep 1, 2026
Merged

feat(web): track Segment client navigations (fixes NV-8755)#178
scopsy merged 4 commits into
mainfrom
cursor/remove-segment-analytics-46f9

Conversation

@scopsy

@scopsy scopsy commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

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 Visit tracker is removed. The Mixpanel SDK and package remain available for other events.

Changes

  • Add client-side SegmentPageTracking using usePathname()
  • Record the initial pathname after the snippet's analytics.page() call
  • Deduplicate route calls across effects and layout remounts
  • Remove MixpanelTracking / Market Page Visit

The 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 typecheck
  • Prettier check for changed components
  • git diff --check
  • Browser route test: the local Next dev process opened port 3000 but repeatedly did not complete the homepage response in the browser harness
  • Full build: compilation and TypeScript succeed, then page-data collection requires the real Sanity project configuration (placeholder project returns dataset 404)

Slack Thread

Open in Web Open in Cursor 

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>
@linear-code

linear-code Bot commented Sep 1, 2026

Copy link
Copy Markdown

NV-8755

@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
website-new Ready Ready Preview Sep 1, 2026 2:11pm UTC

Request Review

@scopsy
scopsy marked this pull request as ready for review September 1, 2026 13:51
cursoragent and others added 2 commits September 1, 2026 14:00
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>
@cursor cursor Bot changed the title chore(web): remove Segment analytics (fixes NV-8755) feat(web): track Segment client navigations (fixes NV-8755) Sep 1, 2026
Co-authored-by: Dima Grossman <dima@grossman.io>
@scopsy
scopsy merged commit 5346442 into main Sep 1, 2026
5 checks passed
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