Skip to content

Commit 5ebc554

Browse files
committed
chore: enhance umami analytics tracking for various user actions
1 parent 5f7a6d2 commit 5ebc554

File tree

13 files changed

+14
-0
lines changed

13 files changed

+14
-0
lines changed

src/components/Composer/NewPublication.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,13 @@ const NewPublication = ({ className, post, feed }: NewPublicationProps) => {
202202
const contentUri = await uploadMetadata(metadata);
203203

204204
if (editingPost) {
205+
umami.track("edit_post");
205206
return await editPost({
206207
variables: { request: { contentUri, post: editingPost?.id } }
207208
});
208209
}
209210

211+
umami.track(isComment ? "comment" : isQuote ? "quote" : "create_post");
210212
return await createPost({
211213
variables: {
212214
request: {

src/components/Post/Actions/Menu/Bookmark.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ const Bookmark = ({ post }: BookmarkProps) => {
8181
return await undoBookmarkPost();
8282
}
8383

84+
umami.track("bookmark_post");
8485
return await bookmarkPost();
8586
};
8687

src/components/Post/Actions/Menu/Report.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const Report = ({ post }: ReportProps) => {
2323
}
2424
onClick={(event) => {
2525
stopEventPropagation(event);
26+
umami.track("open_report_post");
2627
setShowReportPostModal(true, post.id);
2728
}}
2829
>

src/components/Post/Actions/Menu/Share.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const Share = ({ post }: ShareProps) => {
2626
}
2727
onClick={(event) => {
2828
stopEventPropagation(event);
29+
umami.track("copy_post_link");
2930
copyLink();
3031
}}
3132
>

src/components/Post/Actions/Share/Quote.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const Quote = ({ post }: QuoteProps) => {
3030
if (!currentAccount) {
3131
return toast.error(ERRORS.SignWallet);
3232
}
33+
umami.track("open_quote_composer");
3334
setQuotedPost(post);
3435
setShowNewPostModal(true);
3536
}}

src/components/Post/Actions/Share/Repost.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ const Repost = ({ isSubmitting, post, setIsSubmitting }: RepostProps) => {
8686
}
8787

8888
setIsSubmitting(true);
89+
umami.track("repost");
8990

9091
return await repost({ variables: { request: { post: post.id } } });
9192
};

src/components/Post/OpenAction/CollectAction/CollectActionButton.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ const CollectActionButton = ({
123123

124124
const handleCreateCollect = async () => {
125125
setIsSubmitting(true);
126+
umami.track("collect");
126127

127128
return await executePostAction({
128129
variables: {

src/components/Shared/Account/Follow.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ const Follow = ({
8080
}
8181

8282
setIsSubmitting(true);
83+
umami.track("follow");
8384

8485
return await follow({
8586
variables: { request: { account: account.address } }

src/components/Shared/Account/Unfollow.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ const Unfollow = ({
7777
}
7878

7979
setIsSubmitting(true);
80+
umami.track("unfollow");
8081
return await unfollow({
8182
variables: { request: { account: account.address } }
8283
});

src/components/Shared/Auth/Login.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ const Login = ({ setHasAccounts }: LoginProps) => {
117117
const accessToken = auth.data?.authenticate.accessToken;
118118
const refreshToken = auth.data?.authenticate.refreshToken;
119119
signIn({ accessToken, refreshToken });
120+
umami.track("login");
120121
reloadAllTabs();
121122
return;
122123
}

0 commit comments

Comments
 (0)