This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

follow analytics

+10
+10
src/webapp/features/follows/lib/mutations/useToggleFollow.tsx
··· 5 5 import { feedKeys } from '@/features/feeds/lib/feedKeys'; 6 6 import { collectionKeys } from '@/features/collections/lib/collectionKeys'; 7 7 import { profileKeys } from '@/features/profile/lib/profileKeys'; 8 + import posthog from 'posthog-js'; 9 + import { shouldCaptureAnalytics } from '@/features/analytics/utils'; 8 10 9 11 interface ToggleFollowPayload { 10 12 targetId: string; ··· 52 54 console.log( 53 55 `[toggleFollow] intended: ${intended} | result: ${final} | match: ✅`, 54 56 ); 57 + 58 + // Track follow event in PostHog (only on follow, not unfollow) 59 + if (!currentIsFollowing && shouldCaptureAnalytics()) { 60 + posthog.capture('target_followed', { 61 + target_type: targetType.toLowerCase(), 62 + }); 63 + } 64 + 55 65 return !currentIsFollowing; 56 66 } catch { 57 67 const final = currentIsFollowing ? 'followed' : 'unfollowed';