diff --git a/src/app/Scenes/ArtworkLists/SavesTabHeader.tsx b/src/app/Scenes/ArtworkLists/SavesTabHeader.tsx index e8ae4f4dcfc..1c3fe1ec747 100644 --- a/src/app/Scenes/ArtworkLists/SavesTabHeader.tsx +++ b/src/app/Scenes/ArtworkLists/SavesTabHeader.tsx @@ -1,3 +1,4 @@ +import { ActionType, ContextModule, OwnerType } from "@artsy/cohesion" import { AddIcon, Box, @@ -21,6 +22,7 @@ import { ProgressiveOnboardingSignalInterest } from "app/Components/ProgressiveO import { navigate } from "app/system/navigation/navigate" import { useFeatureFlag } from "app/utils/hooks/useFeatureFlag" import { useState } from "react" +import { useTracking } from "react-tracking" const PARTNER_OFFER_HELP_ARTICLE_URL = "https://support.artsy.net/s/article/Offers-on-saved-works" @@ -28,6 +30,7 @@ export const SavesTabHeader = () => { const [modalVisible, setModalVisible] = useState(false) const { dispatch } = useArtworkListsContext() const isArtworkListOfferabilityEnabled = useFeatureFlag("AREnableArtworkListOfferability") + const tracking = useTracking() const handleCreateList = () => { dispatch({ @@ -48,7 +51,14 @@ export const SavesTabHeader = () => { Curate your own lists of the works you love and{" "} - setModalVisible(true)}> + { + tracking.trackEvent(tracks.tapFollowsInfo()) + setModalVisible(true) + }} + > signal your interest to galleries . @@ -100,7 +110,12 @@ export const SavesTabHeader = () => { Signal your interest to galleries and you could receiving an offer on your saved artwork from a gallery.{" "} - navigate(PARTNER_OFFER_HELP_ARTICLE_URL)}> + { + tracking.trackEvent(tracks.tapReadMore()) + navigate(PARTNER_OFFER_HELP_ARTICLE_URL) + }} + > Read more . @@ -133,3 +148,19 @@ export const SavesTabHeaderPlaceholder = () => { ) } + +const tracks = { + tapFollowsInfo: () => ({ + action: ActionType.tappedLink, + context_module: ContextModule.saves, + context_screen_owner_type: OwnerType.saves, + type: "link", + subject: "signalYourInterestToGalleries", + }), + tapReadMore: () => ({ + action: ActionType.tappedLink, + context_module: ContextModule.saves, + context_screen_owner_type: OwnerType.savesInfoModal, + type: "link", + }), +} diff --git a/src/app/Scenes/Favorites/Favorites.tsx b/src/app/Scenes/Favorites/Favorites.tsx index 383953a1480..896145f651e 100644 --- a/src/app/Scenes/Favorites/Favorites.tsx +++ b/src/app/Scenes/Favorites/Favorites.tsx @@ -1,3 +1,4 @@ +import { ActionType, ContextModule, OwnerType, TappedInfoBubble } from "@artsy/cohesion" import { BellIcon, Flex, @@ -75,6 +76,9 @@ export const Favorites: React.FC = () => { BelowTitleHeaderComponent={() => ( { + tracking.trackEvent(tracks.tapFollowsInfo()) + }} titleElement={ Follows @@ -104,7 +108,7 @@ export const Favorites: React.FC = () => { - Never miss out by exploring your Activity and receiving timely email updates + Never miss out by exploring your Activity and receiving timely email updates. @@ -136,3 +140,12 @@ export const Favorites: React.FC = () => { ) } + +const tracks = { + tapFollowsInfo: (): TappedInfoBubble => ({ + action: ActionType.tappedInfoBubble, + context_module: ContextModule.follows, + context_screen_owner_type: OwnerType.follows, + subject: "followsHeader", + }), +} diff --git a/src/app/Scenes/MyCollection/Screens/Insights/CareerHighlightBottomSheet.tests.tsx b/src/app/Scenes/MyCollection/Screens/Insights/CareerHighlightBottomSheet.tests.tsx index abd6de90c0f..28a0308d792 100644 --- a/src/app/Scenes/MyCollection/Screens/Insights/CareerHighlightBottomSheet.tests.tsx +++ b/src/app/Scenes/MyCollection/Screens/Insights/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( - "2016 Group Show @ MOCA Los Angeles; 2015 Reviewed Solo Show @ The Guardian; 2015 Reviewed Solo Show @ Art in America" + "2017 Group Show @ MOCA Los Angeles; 2015 Reviewed Solo Show @ The Guardian; 2015 Reviewed Solo Show @ Art in America" ) expect(result).toEqual({ - 2016: { "Group Show": ["MOCA Los Angeles"] }, + 2017: { "Group Show": ["MOCA Los Angeles"] }, }) }) diff --git a/src/app/Scenes/SavedSearchAlertsList/Components/SavedSearchesList.tsx b/src/app/Scenes/SavedSearchAlertsList/Components/SavedSearchesList.tsx index 5efe73e8533..abc6648e50c 100644 --- a/src/app/Scenes/SavedSearchAlertsList/Components/SavedSearchesList.tsx +++ b/src/app/Scenes/SavedSearchAlertsList/Components/SavedSearchesList.tsx @@ -1,4 +1,4 @@ -import { OwnerType } from "@artsy/cohesion" +import { ActionType, ContextModule, OwnerType, TappedInfoBubble } from "@artsy/cohesion" import { BellIcon, FilterIcon, @@ -30,6 +30,7 @@ import { RefreshEvents, SAVED_ALERT_REFRESH_KEY } from "app/utils/refreshHelpers import { ProvideScreenTracking, Schema } from "app/utils/track" import React, { useEffect, useRef, useState } from "react" import { RelayPaginationProp, createPaginationContainer, graphql } from "react-relay" +import { useTracking } from "react-tracking" import usePrevious from "react-use/lib/usePrevious" import { EmptyMessage } from "./EmptyMessage" import { SavedSearchAlertsListPlaceholder } from "./SavedSearchAlertsListPlaceholder" @@ -159,6 +160,7 @@ export const SavedSearchesListWrapper: React.FC = ( const prevSelectedSortValue = usePrevious(selectedSortValue) const [fetchingMore, setFetchingMore] = useState(false) const [refreshMode, setRefreshMode] = useState(null) + const tracking = useTracking() const handleCloseModal = () => { setModalVisible(false) @@ -240,6 +242,8 @@ export const SavedSearchesListWrapper: React.FC = ( const infoButtonRef = useRef<{ closeModal: () => void } | null>(null) const handleNavigate = () => { + tracking.trackEvent(tracks.tapActivityLink()) + infoButtonRef.current?.closeModal() requestAnimationFrame(() => { @@ -264,6 +268,9 @@ export const SavedSearchesListWrapper: React.FC = ( { + tracking.trackEvent(tracks.tapAlertsInfo()) + }} titleElement={ Alerts @@ -391,3 +398,18 @@ export const SavedSearchesListPaginationContainer = createPaginationContainer( `, } ) + +const tracks = { + tapAlertsInfo: (): TappedInfoBubble => ({ + action: ActionType.tappedInfoBubble, + context_module: ContextModule.alertsList, + context_screen_owner_type: OwnerType.alerts, + subject: "alertsHeader", + }), + tapActivityLink: () => ({ + action: ActionType.tappedLink, + context_module: ContextModule.alertsList, + context_screen_owner_type: OwnerType.alertsInfoModal, + type: "link", + }), +}