From 2383c0f43a95bed0bf74f1daa43ce2eb44afdda7 Mon Sep 17 00:00:00 2001 From: Lily Pace Date: Wed, 17 Dec 2025 14:19:16 -0500 Subject: [PATCH 1/3] feat(DIAM-69): Send analytics event when tapping Complete My Profile --- .../CollectorUpdateNotification.tsx | 16 +++++++++++- .../CollectorUpdateNotification.tests.tsx | 26 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/src/app/Scenes/Activity/components/CollectorUpdateNotification.tsx b/src/app/Scenes/Activity/components/CollectorUpdateNotification.tsx index 9c5d5ebf94a..a1197b2c293 100644 --- a/src/app/Scenes/Activity/components/CollectorUpdateNotification.tsx +++ b/src/app/Scenes/Activity/components/CollectorUpdateNotification.tsx @@ -1,9 +1,11 @@ +import { ActionType, ContextModule, OwnerType, TappedCompleteYourProfile } from "@artsy/cohesion" import { Flex, Text, Touchable } from "@artsy/palette-mobile" import { CollectorUpdateNotification_item$key } from "__generated__/CollectorUpdateNotification_item.graphql" import { CollectorUpdateNotification_notification$key } from "__generated__/CollectorUpdateNotification_notification.graphql" import { MyCollectionBottomSheetModalArtistsPrompt } from "app/Scenes/MyCollection/Components/MyCollectionBottomSheetModals/MyCollectionBottomSheetModalArtistsPrompt" import { FC, useState } from "react" import { graphql, useFragment } from "react-relay" +import { useTracking } from "react-tracking" import { CollectorProfilePrompt } from "./CollectorProfilePrompt" interface CollectorUpdateNotificationProps { @@ -18,6 +20,7 @@ export const CollectorUpdateNotification: FC = onPress, }) => { const [promptVisible, setPromptVisible] = useState(false) + const { trackEvent } = useTracking() const notification = useFragment(NOTIFICATION_FRAGMENT, _notification) const item = useFragment(ITEM_FRAGMENT, _item) @@ -30,6 +33,9 @@ export const CollectorUpdateNotification: FC = const itemInfo = hasEmptyCollection ? addArtistsToCollectiontInfo : collectorProfileInfo const handleOnPress = () => { + if (itemInfo.prompt === "CollectorProfile") { + trackEvent(tracks.tappedCompleteYourProfile()) + } setPromptVisible(true) onPress() } @@ -96,6 +102,14 @@ const addArtistsToCollectiontInfo = { const collectorProfileInfo = { title: "Tell us a little bit more about you.", - body: "By completing your profile, you’re more likely to receive quick responses from galleries.", + body: "By completing your profile, you're more likely to receive quick responses from galleries.", prompt: "CollectorProfile", } + +const tracks = { + tappedCompleteYourProfile: (): TappedCompleteYourProfile => ({ + action: ActionType.tappedCompleteYourProfile, + context_module: ContextModule.collectorProfileCard, + context_screen_owner_type: OwnerType.profile, + }), +} diff --git a/src/app/Scenes/Activity/components/__tests__/CollectorUpdateNotification.tests.tsx b/src/app/Scenes/Activity/components/__tests__/CollectorUpdateNotification.tests.tsx index 20508d1f81f..06f4c56c4df 100644 --- a/src/app/Scenes/Activity/components/__tests__/CollectorUpdateNotification.tests.tsx +++ b/src/app/Scenes/Activity/components/__tests__/CollectorUpdateNotification.tests.tsx @@ -1,12 +1,17 @@ import { fireEvent, screen } from "@testing-library/react-native" import { CollectorUpdateNotification_Test_Query } from "__generated__/CollectorUpdateNotification_Test_Query.graphql" import { CollectorUpdateNotification } from "app/Scenes/Activity/components/CollectorUpdateNotification" +import { mockTrackEvent } from "app/utils/tests/globallyMockedStuff" import { setupTestWrapper } from "app/utils/tests/setupTestWrapper" import { Suspense } from "react" import { graphql } from "react-relay" describe("CollectorUpdateNotification", () => { const onPress = jest.fn() + + beforeEach(() => { + jest.clearAllMocks() + }) const { renderWithRelay } = setupTestWrapper({ Component: ({ notificationsConnection }) => { if (!notificationsConnection.edges?.[0]?.node) { @@ -90,4 +95,25 @@ describe("CollectorUpdateNotification", () => { expect(onPress).toHaveBeenCalledTimes(1) }) + + it("tracks tappedCompleteYourProfile event when collector profile notification is pressed", async () => { + renderWithRelay({ + Me: () => ({ + profession: "Blacksmith", + location: { display: "" }, + }), + CollectorProfileType: () => ({ + lastUpdatePromptAt: "2021-09-01T00:00:00Z", + }), + }) + + const title = await screen.findByText("Tell us a little bit more about you.") + fireEvent.press(title) + + expect(mockTrackEvent).toHaveBeenCalledWith({ + action: "tappedCompleteYourProfile", + context_module: "collectorProfileCard", + context_screen_owner_type: "profile", + }) + }) }) From d05c868d9c9d2450ba57f1a496bdf592ea8f4972 Mon Sep 17 00:00:00 2001 From: Lily Pace Date: Mon, 5 Jan 2026 14:04:10 -0500 Subject: [PATCH 2/3] restored typographic apostrophe --- .../Scenes/Activity/components/CollectorUpdateNotification.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/Scenes/Activity/components/CollectorUpdateNotification.tsx b/src/app/Scenes/Activity/components/CollectorUpdateNotification.tsx index a1197b2c293..c9d84f0f75c 100644 --- a/src/app/Scenes/Activity/components/CollectorUpdateNotification.tsx +++ b/src/app/Scenes/Activity/components/CollectorUpdateNotification.tsx @@ -102,7 +102,7 @@ const addArtistsToCollectiontInfo = { const collectorProfileInfo = { title: "Tell us a little bit more about you.", - body: "By completing your profile, you're more likely to receive quick responses from galleries.", + body: "By completing your profile, you’re more likely to receive quick responses from galleries.", prompt: "CollectorProfile", } From 0fb2324a575665524c4e2464836f138f29e7f0ec Mon Sep 17 00:00:00 2001 From: Lily Pace Date: Tue, 6 Jan 2026 12:38:57 -0500 Subject: [PATCH 3/3] fixed test failing due to new year change --- .../Insights/__tests__/CareerHighlightBottomSheet.tests.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/Scenes/MyCollection/Screens/Insights/__tests__/CareerHighlightBottomSheet.tests.tsx b/src/app/Scenes/MyCollection/Screens/Insights/__tests__/CareerHighlightBottomSheet.tests.tsx index 7676988e54d..49083361db2 100644 --- a/src/app/Scenes/MyCollection/Screens/Insights/__tests__/CareerHighlightBottomSheet.tests.tsx +++ b/src/app/Scenes/MyCollection/Screens/Insights/__tests__/CareerHighlightBottomSheet.tests.tsx @@ -64,11 +64,11 @@ describe(makeCareerHighlightMap, () => { it("Prepares the eventDigest and creates a map of each year to the highlight kind", () => { const result = makeCareerHighlightMap( - "2017 Group Show @ MOCA Los Angeles; 2015 Reviewed Solo Show @ The Guardian; 2015 Reviewed Solo Show @ Art in America" + "2020 Group Show @ MOCA Los Angeles; 2015 Reviewed Solo Show @ The Guardian; 2015 Reviewed Solo Show @ Art in America" ) expect(result).toEqual({ - 2017: { "Group Show": ["MOCA Los Angeles"] }, + 2020: { "Group Show": ["MOCA Los Angeles"] }, }) })