diff options
author | Ansh <anshnanda10@gmail.com> | 2023-06-27 08:11:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-27 10:11:05 -0500 |
commit | a8bbaa06c7266c73f6a71b5e9223c11c96995947 (patch) | |
tree | bae43bbbd724ceb513aa29339273418623b8d7f4 /src/state/models/ui | |
parent | bfaa6d73f37f251259c521befa9e9ee8ea877560 (diff) | |
download | voidsky-a8bbaa06c7266c73f6a71b5e9223c11c96995947.tar.zst |
[APP-705] Metrics revamp pt2 (#896)
* export track function from analytics.tsx * fix create account tracking * fix tracking sign in * add custom feed events * fix type errors * refactor create post event * add profile follow & unfollow events * refactor PostsFeedSliceModel into its own file * refactor PostThreadItemModel into its own file * reorganize code a lil bit * refactor post-thread-item to use post-feed-item model under the hood * add post events * add post reply tracking * track custom feed load more * track list subscribe and unsubscribe
Diffstat (limited to 'src/state/models/ui')
-rw-r--r-- | src/state/models/ui/create-account.ts | 3 | ||||
-rw-r--r-- | src/state/models/ui/saved-feeds.ts | 14 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/state/models/ui/create-account.ts b/src/state/models/ui/create-account.ts index 3f83dd6a7..78ffe8858 100644 --- a/src/state/models/ui/create-account.ts +++ b/src/state/models/ui/create-account.ts @@ -7,6 +7,7 @@ import * as EmailValidator from 'email-validator' import {createFullHandle} from 'lib/strings/handles' import {cleanError} from 'lib/strings/errors' import {getAge} from 'lib/strings/time' +import {track} from 'lib/analytics/analytics' const DEFAULT_DATE = new Date(Date.now() - 60e3 * 60 * 24 * 365 * 20) // default to 20 years ago @@ -117,6 +118,8 @@ export class CreateAccountModel { this.setIsProcessing(false) this.setError(cleanError(errMsg)) throw e + } finally { + track('Create Account') } } diff --git a/src/state/models/ui/saved-feeds.ts b/src/state/models/ui/saved-feeds.ts index 40265f7cf..2dd72980d 100644 --- a/src/state/models/ui/saved-feeds.ts +++ b/src/state/models/ui/saved-feeds.ts @@ -3,6 +3,7 @@ import {RootStoreModel} from '../root-store' import {bundleAsync} from 'lib/async/bundle' import {cleanError} from 'lib/strings/errors' import {CustomFeedModel} from '../feeds/custom-feed' +import {track} from 'lib/analytics/analytics' export class SavedFeedsModel { // state @@ -143,8 +144,16 @@ export class SavedFeedsModel { async togglePinnedFeed(feed: CustomFeedModel) { if (!this.isPinned(feed)) { + track('CustomFeed:Pin', { + name: feed.data.displayName, + uri: feed.uri, + }) return this.rootStore.preferences.addPinnedFeed(feed.uri) } else { + track('CustomFeed:Unpin', { + name: feed.data.displayName, + uri: feed.uri, + }) return this.rootStore.preferences.removePinnedFeed(feed.uri) } } @@ -185,6 +194,11 @@ export class SavedFeedsModel { this.rootStore.preferences.savedFeeds, pinned, ) + track('CustomFeed:Reorder', { + name: item.data.displayName, + uri: item.uri, + index: pinned.indexOf(item.uri), + }) } // state transitions |