alpha
Login
or
Join now
nandi.uk
/
semble
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
follow analytics
author
Wesley Finck
date
4 months ago
(Mar 3, 2026, 4:43 PM -0800)
commit
e2bdd9fb
e2bdd9fbd657014a5714e4e3461aa792b9a65d83
parent
f85b1fb2
f85b1fb2bd4706931f180a0d82370e00f2adf3da
+10
1 changed file
Expand all
Collapse all
Unified
Split
src
webapp
features
follows
lib
mutations
useToggleFollow.tsx
+10
src/webapp/features/follows/lib/mutations/useToggleFollow.tsx
View file
Reviewed
···
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
8
+
import posthog from 'posthog-js';
9
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
57
+
58
58
+
// Track follow event in PostHog (only on follow, not unfollow)
59
59
+
if (!currentIsFollowing && shouldCaptureAnalytics()) {
60
60
+
posthog.capture('target_followed', {
61
61
+
target_type: targetType.toLowerCase(),
62
62
+
});
63
63
+
}
64
64
+
55
65
return !currentIsFollowing;
56
66
} catch {
57
67
const final = currentIsFollowing ? 'followed' : 'unfollowed';