Integrate Mixpanel for user tracking (Cursor Agent Test) #645
+1,150
−1,435
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.
Mixpanel analytics was integrated into the docs site to track user interactions and engagement.
Key changes include:
mixpanel-browserdependency was added topackage.json..env.examplefile was created, andsrc/env.cjswas updated to support theNEXT_PUBLIC_MIXPANEL_TOKENenvironment variable.src/lib/analytics/mixpanel.tsto encapsulate initialization, user identification, and various tracking methods.useMixpanelReact hook was introduced insrc/hooks/useMixpanel.tsfor simplified component-level integration.src/components/AppComponent.tsxwas modified to initialize Mixpanel and track page views on route changes.ThemeToggle,CopyToClipboard, andNavigationCardLinkwere updated to track relevant events (e.g., theme changes, code copying, navigation clicks).docs/mixpanel-analytics-integration.md, detailing setup, tracked events, and usage.This integration enables tracking of page views, button clicks, link clicks, theme toggles, code copying, and keyboard shortcuts, providing insights into user behavior and content performance.