Skip to content

Commit 0ad7eb6

Browse files
dylanjeffersclaude
andauthored
chore(analytics): remove dead Amplitude events and LISTEN_GATED (#14304)
## Summary - Removes zero-callsite `Name` enum entries: `COMMENTS_REPLY_TO_COMMENT`, `CREATOR_NODE_SELECTION`, `SEARCH_TAB_CLICK`, `SERVICE_MONITOR_HEALTH_CHECK`, `SERVICE_MONITOR_REQUEST`, `SIGN_UP_REPAIR_START/SUCCESS/FAILURE` - Removes deprecated social OAuth signup event families: all `CREATE_ACCOUNT_*_TWITTER`, `_INSTAGRAM`, `_TIKTOK` variants (enum entries, payload types, union members) - Removes `BUY_AUDIO` family events (`BUY_AUDIO_SUCCESS`, `BUY_AUDIO_FAILURE`, `BUY_AUDIO_ON_RAMP_*`, `BUY_AUDIO_RECOVERY_*`) replaced by BUY_USDC equivalents - Removes `LISTEN_GATED` fully: enum entry, `ListenGated` payload type, union member, and callsite in `recordListen.ts` - Removes `ARTIST_COIN_PURCHASE` and `ARTIST_RECOMMENDATIONS_POPUP` from `FollowSource` enum and updates their callsites to `FollowSource.OVERFLOW` / `FollowSource.USER_LIST` ## Test plan - [ ] \`npm run typecheck\` passes in \`packages/common\` and \`packages/web\` - [ ] No references to removed enum values remain in the codebase 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 8e43ac1 commit 0ad7eb6

5 files changed

Lines changed: 6 additions & 220 deletions

File tree

packages/common/src/api/tan-query/jupiter/useSwapCoins.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ const autoFollowArtistOnCoinPurchase = async ({
272272

273273
followUser({
274274
followeeUserId: coin.ownerId,
275-
source: FollowSource.ARTIST_COIN_PURCHASE
275+
source: FollowSource.OVERFLOW
276276
})
277277
} catch (error) {
278278
reportToSentry({

packages/common/src/models/Analytics.ts

Lines changed: 1 addition & 209 deletions
Original file line numberDiff line numberDiff line change
@@ -42,30 +42,6 @@ export enum Name {
4242
CREATE_ACCOUNT_COMPLETE_EMAIL = 'Create Account: Complete Email',
4343
// When the user continues past the password page
4444
CREATE_ACCOUNT_COMPLETE_PASSWORD = 'Create Account: Complete Password',
45-
// When the user starts integrating with twitter
46-
CREATE_ACCOUNT_START_TWITTER = 'Create Account: Start Twitter',
47-
// When the user successfully continues past the "twitter connection page"
48-
CREATE_ACCOUNT_COMPLETE_TWITTER = 'Create Account: Complete Twitter',
49-
// When the user closed the twitter oauth modal
50-
CREATE_ACCOUNT_CLOSED_TWITTER = 'Create Account: Closed Twitter',
51-
// When the user encounters an error during twitter oauth
52-
CREATE_ACCOUNT_TWITTER_ERROR = 'Create Account: Twitter Error',
53-
// When the user starts integrating with instagram
54-
CREATE_ACCOUNT_START_INSTAGRAM = 'Create Account: Start Instagram',
55-
// When the user continues past the "instagram connection page"
56-
CREATE_ACCOUNT_COMPLETE_INSTAGRAM = 'Create Account: Complete Instagram',
57-
// When the user closed the instagram oauth modal
58-
CREATE_ACCOUNT_CLOSED_INSTAGRAM = 'Create Account: Closed Instagram',
59-
// When the user encounters an error during instagram oauth
60-
CREATE_ACCOUNT_INSTAGRAM_ERROR = 'Create Account: Error Instagram',
61-
// When the user starts integrating with tiktok
62-
CREATE_ACCOUNT_START_TIKTOK = 'Create Account: Start TikTok',
63-
// When the user continues past the "tiktok connection page"
64-
CREATE_ACCOUNT_COMPLETE_TIKTOK = 'Create Account: Complete TikTok',
65-
// When the user closes the tiktok oauth modal
66-
CREATE_ACCOUNT_CLOSED_TIKTOK = 'Create Account: Closed TikTok',
67-
// Errors encountered during tiktok oauth
68-
CREATE_ACCOUNT_TIKTOK_ERROR = 'Create Account: TikTok Error',
6945
// When the user continues past the "profile info page"
7046
CREATE_ACCOUNT_COMPLETE_PROFILE = 'Create Account: Complete Profile',
7147
// When the user uploads a profile photo in signup
@@ -238,9 +214,6 @@ export enum Name {
238214
COLLECTION_EDIT_ACCESS_CHANGED = 'Collection Edit: Access Changed',
239215
COLLECTION_EDIT = 'Collection Edit: General Edits',
240216

241-
// Gated Track Listen
242-
LISTEN_GATED = 'Listen: Gated',
243-
244217
// Unlocked Gated Tracks
245218
USDC_PURCHASE_GATED_TRACK_UNLOCKED = 'USDC Gated: Track Unlocked',
246219
USDC_PURCHASE_GATED_COLLECTION_UNLOCKED = 'USDC Gated: Collection Unlocked',
@@ -319,7 +292,6 @@ export enum Name {
319292
SEARCH_TAG_SEARCH = 'Search: Tag Search',
320293
SEARCH_MORE_RESULTS = 'Search: More Results',
321294
SEARCH_RESULT_SELECT = 'Search: Result Select',
322-
SEARCH_TAB_CLICK = 'Search: Tab Click',
323295

324296
// Explore
325297
EXPLORE_SECTION_VIEW = 'Explore: Section View',
@@ -332,7 +304,6 @@ export enum Name {
332304
// System
333305
WEB_VITALS = 'Web Vitals',
334306
PERFORMANCE = 'Performance',
335-
CREATOR_NODE_SELECTION = 'Creator Node Selection',
336307

337308
// Remixes
338309
STEM_COMPLETE_UPLOAD = 'Stem: Complete Upload',
@@ -352,10 +323,6 @@ export enum Name {
352323
TRANSFER_AUDIO_TO_WAUDIO_SUCCESS = 'TRANSFER_AUDIO_TO_WAUDIO_SUCCESS',
353324
TRANSFER_AUDIO_TO_WAUDIO_FAILURE = 'TRANSFER_AUDIO_TO_WAUDIO_FAILURE',
354325

355-
// Service monitoring
356-
SERVICE_MONITOR_REQUEST = 'Service Monitor: Request',
357-
SERVICE_MONITOR_HEALTH_CHECK = 'Service Monitor: Status',
358-
359326
// Playlist library
360327
PLAYLIST_LIBRARY_REORDER = 'Playlist Library: Reorder',
361328
PLAYLIST_LIBRARY_MOVE_PLAYLIST_INTO_FOLDER = 'Playlist Library: Move Playlist Into Folder',
@@ -392,18 +359,6 @@ export enum Name {
392359
SOCIAL_PROOF_SUCCESS = 'Social Proof: Success',
393360
SOCIAL_PROOF_ERROR = 'Social Proof: Error',
394361

395-
// Buy Audio
396-
BUY_AUDIO_ON_RAMP_OPENED = 'Buy Audio: On Ramp Opened',
397-
BUY_AUDIO_ON_RAMP_CANCELED = 'Buy Audio: On Ramp Canceled',
398-
BUY_AUDIO_ON_RAMP_SUCCESS = 'Buy Audio: On Ramp Success',
399-
BUY_AUDIO_SUCCESS = 'Buy Audio: Success',
400-
BUY_AUDIO_FAILURE = 'Buy Audio: Failure',
401-
402-
// Buy Audio Recovery
403-
BUY_AUDIO_RECOVERY_OPENED = 'Buy Audio Recovery: Opened',
404-
BUY_AUDIO_RECOVERY_SUCCESS = 'Buy Audio Recovery: Success',
405-
BUY_AUDIO_RECOVERY_FAILURE = 'Buy Audio Recovery: Failure',
406-
407362
// Buy USDC
408363
BUY_USDC_ON_RAMP_OPENED = 'Buy USDC: On Ramp Opened',
409364
BUY_USDC_ON_RAMP_CANCELED = 'Buy USDC: On Ramp Canceled',
@@ -502,11 +457,6 @@ export enum Name {
502457
JUPITER_QUOTE_REQUEST = 'Jupiter: Quote Request',
503458
JUPITER_QUOTE_RESPONSE = 'Jupiter: Quote Response',
504459

505-
// Repair Signups
506-
SIGN_UP_REPAIR_START = 'Sign Up Repair: Start',
507-
SIGN_UP_REPAIR_SUCCESS = 'Sign Up Repair: Success',
508-
SIGN_UP_REPAIR_FAILURE = 'Sign Up Repair: Failure',
509-
510460
// Export Private Key
511461
EXPORT_PRIVATE_KEY_LINK_CLICKED = 'Export Private Key: Settings Link Clicked',
512462
EXPORT_PRIVATE_KEY_PAGE_VIEWED = 'Export Private Key: Page Viewed',
@@ -526,7 +476,6 @@ export enum Name {
526476
COMMENTS_CREATE_COMMENT = 'Comments: Create Comment',
527477
COMMENTS_UPDATE_COMMENT = 'Comments: Update Comment',
528478
COMMENTS_DELETE_COMMENT = 'Comments: Delete Comment',
529-
COMMENTS_REPLY_TO_COMMENT = 'Comments: Reply to Comment',
530479
COMMENTS_FOCUS_COMMENT_INPUT = 'Comments: Focus Comment Input',
531480
COMMENTS_CLICK_REPLY_BUTTON = 'Comments: Click Reply Button',
532481
COMMENTS_LIKE_COMMENT = 'Comments: Like Comment',
@@ -666,84 +615,6 @@ type CreateAccountCompletePassword = {
666615
eventName: Name.CREATE_ACCOUNT_COMPLETE_PASSWORD
667616
emailAddress: string
668617
}
669-
// Twitter Account Creation
670-
type CreateAccountStartTwitter = {
671-
eventName: Name.CREATE_ACCOUNT_START_TWITTER
672-
emailAddress?: string
673-
page?: 'create-email' | 'pick-handle'
674-
}
675-
type CreateAccountCompleteTwitter = {
676-
eventName: Name.CREATE_ACCOUNT_COMPLETE_TWITTER
677-
isVerified: boolean
678-
emailAddress?: string
679-
handle: string
680-
page?: 'create-email' | 'pick-handle'
681-
}
682-
type CreateAccountClosedTwitter = {
683-
eventName: Name.CREATE_ACCOUNT_CLOSED_TWITTER
684-
emailAddress?: string
685-
page?: 'create-email' | 'pick-handle'
686-
}
687-
type CreateAccountTwitterError = {
688-
eventName: Name.CREATE_ACCOUNT_TWITTER_ERROR
689-
emailAddress?: string
690-
error?: string
691-
page?: 'create-email' | 'pick-handle'
692-
}
693-
694-
// Instagram Account Creation
695-
type CreateAccountStartInstagram = {
696-
eventName: Name.CREATE_ACCOUNT_START_INSTAGRAM
697-
emailAddress?: string
698-
page?: string
699-
}
700-
type CreateAccountCompleteInstagram = {
701-
eventName: Name.CREATE_ACCOUNT_COMPLETE_INSTAGRAM
702-
isVerified: boolean
703-
emailAddress?: string
704-
handle: string
705-
page?: string
706-
}
707-
type CreateAccountClosedInstagram = {
708-
eventName: Name.CREATE_ACCOUNT_CLOSED_INSTAGRAM
709-
emailAddress?: string
710-
page?: 'create-email' | 'pick-handle'
711-
}
712-
type CreateAccountInstagramError = {
713-
eventName: Name.CREATE_ACCOUNT_INSTAGRAM_ERROR
714-
emailAddress?: string
715-
error?: string
716-
page?: 'create-email' | 'pick-handle'
717-
}
718-
719-
// TikTok account creation
720-
type CreateAccountStartTikTok = {
721-
eventName: Name.CREATE_ACCOUNT_START_TIKTOK
722-
emailAddress?: string
723-
page?: string
724-
}
725-
type CreateAccountClosedTikTok = {
726-
eventName: Name.CREATE_ACCOUNT_CLOSED_TIKTOK
727-
page?: 'create-email' | 'pick-handle'
728-
}
729-
type CreateAccountCompleteTikTok =
730-
| {
731-
eventName: Name.CREATE_ACCOUNT_COMPLETE_TIKTOK
732-
emailAddress: string
733-
page?: string
734-
}
735-
| {
736-
eventName: Name.CREATE_ACCOUNT_COMPLETE_TIKTOK
737-
isVerified: boolean
738-
handle: string
739-
page?: string
740-
}
741-
type CreateAccountTikTokError = {
742-
eventName: Name.CREATE_ACCOUNT_TIKTOK_ERROR
743-
error?: string
744-
page?: 'create-email' | 'pick-handle'
745-
}
746-
747618
type CreateAccountUploadProfilePhoto = {
748619
eventName: Name.CREATE_ACCOUNT_UPLOAD_PROFILE_PHOTO
749620
emailAddress?: string
@@ -979,12 +850,10 @@ export enum FollowSource {
979850
HOVER_TILE = 'hover tile',
980851
OVERFLOW = 'overflow',
981852
USER_LIST = 'user list',
982-
ARTIST_RECOMMENDATIONS_POPUP = 'artist recommendations popup',
983853
EMPTY_FEED = 'empty feed',
984854
HOW_TO_UNLOCK_TRACK_PAGE = 'how to unlock track page',
985855
HOW_TO_UNLOCK_MODAL = 'how to unlock modal',
986-
SIGN_UP = 'sign up',
987-
ARTIST_COIN_PURCHASE = 'artist coin purchase'
856+
SIGN_UP = 'sign up'
988857
}
989858

990859
type Share = {
@@ -1667,11 +1536,6 @@ type ExploreSectionClick = {
16671536
link?: string
16681537
}
16691538

1670-
type ListenGated = {
1671-
eventName: Name.LISTEN_GATED
1672-
trackId: string
1673-
}
1674-
16751539
type OnFirstPage = {
16761540
eventName: Name.ON_FIRST_PAGE
16771541
}
@@ -2026,57 +1890,6 @@ type AuthorizedAppRemoveError = {
20261890
error?: string
20271891
}
20281892

2029-
type BuyAudioOnRampOpened = {
2030-
eventName: Name.BUY_AUDIO_ON_RAMP_OPENED
2031-
provider: string
2032-
}
2033-
2034-
type BuyAudioOnRampCanceled = {
2035-
eventName: Name.BUY_AUDIO_ON_RAMP_CANCELED
2036-
provider: string
2037-
}
2038-
2039-
type BuyAudioOnRampSuccess = {
2040-
eventName: Name.BUY_AUDIO_ON_RAMP_SUCCESS
2041-
provider: string
2042-
}
2043-
2044-
type BuyAudioSuccess = {
2045-
eventName: Name.BUY_AUDIO_SUCCESS
2046-
provider: string
2047-
requestedAudio: number
2048-
actualAudio: number
2049-
surplusAudio: number
2050-
}
2051-
2052-
type BuyAudioFailure = {
2053-
eventName: Name.BUY_AUDIO_FAILURE
2054-
provider: string
2055-
requestedAudio: number
2056-
stage: string
2057-
error: string
2058-
}
2059-
2060-
type BuyAudioRecoveryOpened = {
2061-
eventName: Name.BUY_AUDIO_RECOVERY_OPENED
2062-
provider: string
2063-
trigger: string
2064-
balance: string
2065-
}
2066-
2067-
type BuyAudioRecoverySuccess = {
2068-
eventName: Name.BUY_AUDIO_RECOVERY_SUCCESS
2069-
provider: string
2070-
audioRecovered: number
2071-
}
2072-
2073-
type BuyAudioRecoveryFailure = {
2074-
eventName: Name.BUY_AUDIO_RECOVERY_FAILURE
2075-
provider: string
2076-
stage: string
2077-
error: string
2078-
}
2079-
20801893
// Buy USDC
20811894
type BuyUSDCOnRampOpened = {
20821895
eventName: Name.BUY_USDC_ON_RAMP_OPENED
@@ -3161,22 +2974,10 @@ export type AllTrackingEvents =
31612974
| CreateAccountOpen
31622975
| CreateAccountCompleteEmail
31632976
| CreateAccountCompletePassword
3164-
| CreateAccountStartTwitter
3165-
| CreateAccountCompleteTwitter
3166-
| CreateAccountStartInstagram
3167-
| CreateAccountCompleteInstagram
3168-
| CreateAccountStartTikTok
3169-
| CreateAccountClosedTikTok
3170-
| CreateAccountCompleteTikTok
31712977
| CreateAccountCompleteProfile
31722978
| CreateAccountCompleteFollow
31732979
| CreateAccountCompleteCreating
31742980
| CreateAccountOpenFinish
3175-
| CreateAccountClosedTwitter
3176-
| CreateAccountTikTokError
3177-
| CreateAccountTwitterError
3178-
| CreateAccountClosedInstagram
3179-
| CreateAccountInstagramError
31802981
| CreateAccountUploadProfilePhoto
31812982
| CreateAccountUploadProfilePhotoError
31822983
| CreateAccountUploadProfileCover
@@ -3308,7 +3109,6 @@ export type AllTrackingEvents =
33083109
| SearchResultSelect
33093110
| ExploreSectionView
33103111
| ExploreSectionClick
3311-
| ListenGated
33123112
| ErrorPage
33133113
| NotFoundPage
33143114
| PageView
@@ -3366,14 +3166,6 @@ export type AllTrackingEvents =
33663166
| AudiusOauthComplete
33673167
| AudiusOauthSubmit
33683168
| AudiusOauthError
3369-
| BuyAudioOnRampOpened
3370-
| BuyAudioOnRampSuccess
3371-
| BuyAudioOnRampCanceled
3372-
| BuyAudioSuccess
3373-
| BuyAudioFailure
3374-
| BuyAudioRecoveryOpened
3375-
| BuyAudioRecoverySuccess
3376-
| BuyAudioRecoveryFailure
33773169
| BuyUSDCOnRampOpened
33783170
| BuyUSDCOnRampSuccess
33793171
| BuyUSDCOnRampCanceled

packages/mobile/src/screens/profile-screen/ArtistRecommendations/ArtistRecommendations.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const ArtistRecommendations = (props: ArtistRecommendationsProps) => {
5555
const handlePressFollow = useCallback(() => {
5656
suggestedArtists.forEach((artist) => {
5757
dispatch(
58-
followUser(artist.user_id, FollowSource.ARTIST_RECOMMENDATIONS_POPUP)
58+
followUser(artist.user_id, FollowSource.USER_LIST)
5959
)
6060
})
6161
setHasFollowedAll(true)
@@ -64,7 +64,7 @@ export const ArtistRecommendations = (props: ArtistRecommendationsProps) => {
6464
const handlePressUnfollow = useCallback(() => {
6565
suggestedArtists.forEach((artist) => {
6666
dispatch(
67-
unfollowUser(artist.user_id, FollowSource.ARTIST_RECOMMENDATIONS_POPUP)
67+
unfollowUser(artist.user_id, FollowSource.USER_LIST)
6868
)
6969
})
7070
setHasFollowedAll(false)

packages/web/src/common/store/social/tracks/recordListen.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { queryCurrentUserId, queryTrack } from '@audius/common/api'
2-
import { Name } from '@audius/common/models'
32
import {
43
audioRewardsPageActions,
54
tracksSocialActions,
@@ -8,7 +7,6 @@ import {
87
} from '@audius/common/store'
98
import { call, put, takeEvery } from 'typed-redux-saga'
109

11-
import { make } from 'common/store/analytics/actions'
1210
import { waitForWrite } from 'utils/sagaHelpers'
1311

1412
const { updateOptimisticListenStreak, updateOptimisticPlayCount } =
@@ -30,10 +28,6 @@ function* recordListen(action: { trackId: number }) {
3028

3129
yield* call(audiusBackendInstance.recordTrackListen, { userId, trackId, sdk })
3230

33-
if (track.is_stream_gated) {
34-
yield* put(make(Name.LISTEN_GATED, { trackId }))
35-
}
36-
3731
// Optimistically update the listen streak if applicable
3832
yield* put(updateOptimisticListenStreak())
3933

packages/web/src/components/artist-recommendations/ArtistRecommendations.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export const ArtistRecommendations = forwardRef<
118118
dispatch(
119119
socialActions.followUser(
120120
a.user_id,
121-
FollowSource.ARTIST_RECOMMENDATIONS_POPUP
121+
FollowSource.USER_LIST
122122
)
123123
)
124124
})
@@ -130,7 +130,7 @@ export const ArtistRecommendations = forwardRef<
130130
dispatch(
131131
socialActions.unfollowUser(
132132
a.user_id,
133-
FollowSource.ARTIST_RECOMMENDATIONS_POPUP
133+
FollowSource.USER_LIST
134134
)
135135
)
136136
})

0 commit comments

Comments
 (0)