You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Add PostHog Analytics Identification for Accounts and Teams
This PR adds analytics tracking capabilities to identify users and teams in PostHog:
- Created two new hooks:
- `useIdentifyAccount`: Identifies users by their account ID and optional email
- `useIdentifyTeam`: Identifies teams by their team ID using PostHog's group functionality
- Implemented these hooks in the `TeamHeaderLoggedIn` component to track both the current user and team
Both hooks include safety checks to ensure PostHog is properly loaded before attempting to identify users or teams.
<!-- start pr-codex -->
---
## PR-Codex overview
This PR focuses on integrating `posthog-js` analytics functionalities into various components of the application, specifically for resetting analytics on logout and identifying users and teams.
### Detailed summary
- Added `resetAnalytics` function in `reset.ts` to reset analytics.
- Implemented `useIdentifyTeam` hook in `identify-team.ts` for team identification.
- Implemented `useIdentifyAccount` hook in `identify-account.ts` for account identification.
- Integrated `resetAnalytics` in logout processes across multiple components:
- `CustomConnectWallet`
- `AccountHeader`
- `AccountSettingsPage`
- `LoginPage`
- `TeamHeaderLoggedIn`
- Updated ESLint rules to allow direct imports of `posthog-js` within analytics helpers.
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Introduced automatic analytics identification for user accounts and teams within the dashboard.
- Added a function to reset analytics data, now triggered on logout, wallet disconnection, and account deletion.
- **Chores**
- Updated internal configuration to ensure analytics tracking is consistently managed and restricted to designated areas.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
0 commit comments