Skip to content

Remove posthog from codebase#3432

Merged
steven-tey merged 1 commit intomainfrom
remove-posthog
Feb 6, 2026
Merged

Remove posthog from codebase#3432
steven-tey merged 1 commit intomainfrom
remove-posthog

Conversation

@steven-tey
Copy link
Collaborator

@steven-tey steven-tey commented Feb 6, 2026

Summary by CodeRabbit

Release Notes

  • Chores

    • Streamlined analytics infrastructure and dependencies to improve application performance and reduce resource overhead
    • Optimized backend tracking system configuration for better efficiency
  • Refactor

    • Enhanced upgrade plan workflow to provide improved handling of existing payment methods and subscription states, ensuring smoother transitions when changing plans

@vercel
Copy link
Contributor

vercel bot commented Feb 6, 2026

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

Project Deployment Actions Updated (UTC)
dub Ready Ready Preview Feb 6, 2026 7:56pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 6, 2026

📝 Walkthrough

Walkthrough

This pull request removes PostHog analytics integration from the web application. PostHog imports and event capture calls are deleted across multiple components and files. The PostHog provider is removed from the root provider composition. The posthog-js dependency is removed from package.json. One component (upgrade-plan-button.tsx) gains behavioral changes around stripeId handling.

Changes

Cohort / File(s) Summary
Root Provider Configuration
apps/web/app/providers.tsx, apps/web/package.json
Removed PostHog provider initialization, imports, and configuration. Removed GA params hook. Simplified provider nesting; PostHog dependency removed from package.json.
Page-Level Tracking
apps/web/app/app.dub.co/(dashboard)/[slug]/links/page-client.tsx, apps/web/app/app.dub.co/(onboarding)/onboarding/welcome/track-signup.tsx, apps/web/ui/layout/posthog-pageview.tsx
Removed PostHog session tracking and pageview integration. Deleted useSession and PosthogPageview component; retained Plausible tracking.
Workspace & Collaboration Components
apps/web/ui/workspaces/create-workspace-form.tsx, apps/web/ui/workspaces/invite-teammates-form.tsx, apps/web/ui/workspaces/upgrade-plan-button.tsx, apps/web/app/app.dub.co/(invites)/[slug]/invite/accept-invite-button.tsx
Removed PostHog event capture for workspace creation, team invitations, and invite acceptance. upgrade-plan-button.tsx now includes stripeId availability check and conditional redirect logic.
Modal & Form Components
apps/web/ui/modals/add-edit-tag-modal.tsx, apps/web/ui/modals/add-edit-utm-template.modal.tsx, apps/web/ui/modals/link-builder/og-modal.tsx, apps/web/ui/modals/upgraded-modal.tsx, apps/web/ui/domains/add-edit-domain-form.tsx
Removed PostHog event capture for tag, UTM template, OG content, domain, and plan upgrade operations; API and state management logic unchanged.
Link Builder Components
apps/web/ui/links/link-builder/tag-select.tsx, apps/web/ui/links/link-builder/use-link-builder-submit.tsx, apps/web/ui/links/short-link-input.tsx
Removed PostHog event capture from AI-suggested tag selection, link creation/updates, and AI key generation workflows.
Analytics Utilities
apps/web/ui/analytics/use-analytics-filters.tsx
Removed PostHog event capture from AI-generated filters flow; Plausible analytics remains.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 PostHog's journeys fade to quiet streams,
Analytics drift like forgotten dreams,
No more events will trace our way,
Just Plausible truths shall stay,
The rabbit hops on, lighter, free! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title directly and clearly summarizes the main change: removing PostHog analytics integration throughout the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch remove-posthog

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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/web/ui/workspaces/upgrade-plan-button.tsx (1)

70-80: ⚠️ Potential issue | 🔴 Critical

Fix the mismatch between client-side and server-side upgrade logic.

The condition on line 72 (!stripeId || currentPlan === "free") does not align with the server-side endpoint's decision logic. The server returns { url } when workspace.stripeId && activeSubscription exists, but the client expects { url } when stripeId && currentPlan !== "free". These conditions differ:

  • If a workspace has stripeId but no active subscription (e.g., canceled), the server returns { id } but the client expects { url }, causing router.push(undefined).
  • If a workspace is on the "free" plan but has an active subscription, the server returns { url } but the client expects { id }, causing stripe.redirectToCheckout({ sessionId: undefined }).

Either align the client condition to match the server's activeSubscription check, or update the server logic to check currentPlan instead.

🧹 Nitpick comments (1)
apps/web/ui/modals/link-builder/og-modal.tsx (1)

168-170: Remove unused parameters for consistency with the title completion handler.

The (_, __) parameters are leftover from the removed posthog.capture call. The title completion's onFinish on line 122 already uses the cleaner () => form.

Suggested fix
-    onFinish: (_, __) => {
+    onFinish: () => {
       mutate();
     },

@steven-tey steven-tey merged commit 9592c96 into main Feb 6, 2026
11 checks passed
@steven-tey steven-tey deleted the remove-posthog branch February 6, 2026 20:04
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