Skip to content

Conversation

@kennethkalmer
Copy link
Member

@kennethkalmer kennethkalmer commented Dec 1, 2025

Summary

Disables automatic pageview tracking in Mixpanel's autocapture feature by adding pageview: false to the autocapture configuration.

Before

Here is a screenshot from Voltaire before this fix, auto capture is enabled as well as debugging. When filtering for Mixpanel I can see duplicate $mp_web_page_view events:

Screenshot 2025-12-02 at 12 20 17

The "autocapture" logging also shows "Initializing pageview tracking" as enabled

After

Here is a screenshot from Voltaire with auto capture enabled as well as debugging, note when I filter the console I only see one $mp_web_page_view event:

Screenshot 2025-12-02 at 12 17 02

The "autocapture" logging no longer shows "Initializing pageview tracking"

Changes

  • Added pageview: false to the Mixpanel autocapture config in src/core/insights/mixpanel.ts
  • Bumped version to 17.9.12

Reason

We track pageviews manually using our own trackPageView function, so we don't need Mixpanel's autocapture to also track pageviews automatically. This prevents duplicate pageview events.

Related

Summary by CodeRabbit

Release Notes

Chores

  • Version bump to 17.9.12
  • Updated development environment configuration
  • Adjusted analytics settings for improved tracking accuracy

✏️ Tip: You can customize this high-level summary in your review settings.

We track pageviews manually, so disable the automatic pageview tracking
that's built into Mixpanel's autocapture feature.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 1, 2025

Walkthrough

Version bump from 17.9.11 to 17.9.12 with gitignore updates for local development tools (.idea/, .claude/settings.local.json) and a Mixpanel configuration adjustment adding pageview: false to disable autocapture page view tracking in favor of manual tracking.

Changes

Cohort / File(s) Change Summary
Development Configuration
.gitignore
Deleted and re-added /src/core/Icon/components/ (no net change); added .idea/ and .claude/settings.local.json to ignore list for IDE and Claude settings
Version Update
package.json
Bumped version from 17.9.11 to 17.9.12
Mixpanel Tracking Configuration
src/core/insights/mixpanel.ts
Added pageview: false configuration field in initMixpanel when autocapture is enabled to enforce manual pageview tracking alongside existing track_pageview: false setting

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Mixpanel config change: Verify that adding pageview: false correctly addresses the AccountId tracking issue and does not conflict with existing manual pageview logic
  • Gitignore additions: Confirm .idea/ and .claude/settings.local.json are appropriate for team workflows

Poem

🐰 A version hops ahead with gentle care,
Gitignore grows with settings tucked with flair,
Mixpanel's pages now dance to our tune,
Manual tracking beneath December's moon! 🌙

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR addresses duplicate pageview events by disabling Mixpanel autocapture pageview tracking, but does not address the primary issue WEB-4827 objective of investigating missing AccountIds in Mixpanel. Clarify the relationship between this pageview fix and the AccountId tracking issue WEB-4827, or verify if this is a prerequisite change that supports the broader AccountId investigation.
Out of Scope Changes check ❓ Inconclusive The changes align with the stated PR objectives: pageview configuration update and version bump. However, the connection to the linked issue WEB-4827 (AccountId tracking) is unclear. Verify whether disabling pageview autocapture is directly related to fixing the AccountId tracking issue, or if this PR should reference a different issue.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: disabling automatic pageview tracking in Mixpanel's autocapture feature.
Description check ✅ Passed The description includes clear motivation, before/after screenshots, changes summary, and reasoning. However, required sections like 'How do you manually test this?' and the merge checklist are incomplete or missing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 WEB-4827-tweak-mp-auto-capture

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 1bbd348 and 7d4531b.

📒 Files selected for processing (3)
  • .gitignore (1 hunks)
  • package.json (1 hunks)
  • src/core/insights/mixpanel.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Run linters and tests
🔇 Additional comments (3)
package.json (1)

3-3: LGTM! Version bump is appropriate.

The patch version increment from 17.9.11 to 17.9.12 is appropriate for this configuration change.

.gitignore (1)

13-17: LGTM! Standard local development tool ignores.

The additions for .idea/* (JetBrains IDEs) and .claude/settings.local.json (Claude AI local settings) are appropriate for preventing local development tool configurations from being committed.

src/core/insights/mixpanel.ts (1)

24-24: LGTM! Change aligns with preventing duplicate pageview events.

The pageview: false option is supported in mixpanel-browser 2.60.0's autocapture configuration and correctly disables autocapture's automatic pageview tracking. This allows the manual trackPageView function (line 101) to be the sole source of pageview events, eliminating the duplicate $mp_web_page_view events mentioned in the PR description.


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

@kennethkalmer kennethkalmer self-assigned this Dec 1, 2025
@kennethkalmer kennethkalmer changed the title feat: disable automatic pageview tracking in Mixpanel autocapture [WEB-4827] Disable automatic pageview tracking in Mixpanel autocapture Dec 2, 2025
@kennethkalmer kennethkalmer force-pushed the WEB-4827-tweak-mp-auto-capture branch from 04db1ba to 7d4531b Compare December 2, 2025 12:23
@kennethkalmer kennethkalmer marked this pull request as ready for review December 2, 2025 12:23
@kennethkalmer kennethkalmer requested a review from a team as a code owner December 2, 2025 12:23
@kennethkalmer kennethkalmer merged commit e5a7d2f into main Dec 2, 2025
4 checks passed
@kennethkalmer kennethkalmer deleted the WEB-4827-tweak-mp-auto-capture branch December 2, 2025 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants