Skip to content

Commit 470d356

Browse files
authored
Merge pull request #254 from YAPP-Github/refactor/YS-564
모바일 mixpanel 트래킹 이벤트 추가 및 copy 이벤트 세분화
2 parents 4b966c2 + 08bfad2 commit 470d356

4 files changed

Lines changed: 19 additions & 8 deletions

File tree

src/app/post/[postId]/desktop/components/ExperimentPostOutline/ExperimentPostOutline.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ const ExperimentPostOutline = ({ postDetailData, applyMethodData }: ExperimentPo
135135
onClick={() => {
136136
trackEvent('ApplyMethod Interaction', {
137137
action: 'Click ApplyMethod Modal',
138+
device: 'desktop',
138139
});
139140
setIsModalOpen(true);
140141
}}

src/app/post/[postId]/desktop/components/ParticipationGuideModal/ParticipationGuideModal.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ const ParticipationGuideModal = ({
3232
}: ParticipationGuideModalProps) => {
3333
const toast = useToast();
3434

35-
const handleCopyContent = (text: string) => {
35+
const handleCopyContent = (text: string, type: 'link' | 'contactInfo') => {
3636
navigator.clipboard
3737
.writeText(text)
3838
.then(() => {
3939
toast.open({ message: '복사되었어요', duration: 1500 });
4040
trackEvent('ApplyMethod Interaction', {
41-
action: 'Link Copied',
41+
action: type === 'link' ? 'Link Copied' : 'ContactInfo Copied',
4242
});
4343
})
4444
.catch(() => {
@@ -108,7 +108,8 @@ const ParticipationGuideModal = ({
108108
height={16}
109109
cursor="pointer"
110110
onClick={() =>
111-
applyMethodData.formUrl && handleCopyContent(applyMethodData.formUrl)
111+
applyMethodData.formUrl &&
112+
handleCopyContent(applyMethodData.formUrl, 'link')
112113
}
113114
/>
114115
</div>
@@ -127,7 +128,8 @@ const ParticipationGuideModal = ({
127128
height={16}
128129
cursor="pointer"
129130
onClick={() =>
130-
applyMethodData.phoneNum && handleCopyContent(applyMethodData.phoneNum)
131+
applyMethodData.phoneNum &&
132+
handleCopyContent(applyMethodData.phoneNum, 'contactInfo')
131133
}
132134
/>
133135
</div>

src/app/post/[postId]/mobile/components/ExperimentPostMobileContentWrapper/ExperimentPostMobileContentWrapper.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import ParticipationGuideBottomSheet from '../ParticipationGuideBottomSheet/Part
1313

1414
import Button from '@/components/Button/Button';
1515
import useOverlay from '@/hooks/useOverlay';
16+
import { trackEvent } from '@/lib/mixpanelClient';
1617

1718
const ExperimentPostMobileContentWrapper = ({
1819
postDetailData,
@@ -24,6 +25,11 @@ const ExperimentPostMobileContentWrapper = ({
2425
const { open, close } = useOverlay();
2526

2627
const handleOpenBottomSheet = () => {
28+
trackEvent('ApplyMethod Interaction', {
29+
action: 'Click ApplyMethod Modal',
30+
device: 'mobile',
31+
});
32+
2733
open(
2834
() => <ParticipationGuideBottomSheet onConfirm={close} applyMethodData={applyMethodData} />,
2935
{

src/app/post/[postId]/mobile/components/ParticipationGuideBottomSheet/ParticipationGuideBottomSheet.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ const ParticipationGuideBottomSheet = ({
2020
applyMethodData,
2121
}: ParticipationGuideBottomSheetProps) => {
2222
const toast = useToast();
23-
const handleCopyContent = (text: string) => {
23+
const handleCopyContent = (text: string, type: 'link' | 'contactInfo') => {
2424
navigator.clipboard
2525
.writeText(text)
2626
.then(() => {
2727
toast.open({ message: '복사되었어요' });
28+
2829
trackEvent('ApplyMethod Interaction', {
29-
action: 'Link Copied',
30+
action: type === 'link' ? 'Link Copied' : 'ContactInfo Copied',
3031
});
3132
})
3233
.catch(() => {
@@ -79,7 +80,7 @@ const ParticipationGuideBottomSheet = ({
7980
cursor="pointer"
8081
color={colors.text04}
8182
onClick={() =>
82-
applyMethodData.formUrl && handleCopyContent(applyMethodData.formUrl)
83+
applyMethodData.formUrl && handleCopyContent(applyMethodData.formUrl, 'link')
8384
}
8485
/>
8586
</div>
@@ -99,7 +100,8 @@ const ParticipationGuideBottomSheet = ({
99100
cursor="pointer"
100101
color={colors.text04}
101102
onClick={() =>
102-
applyMethodData.phoneNum && handleCopyContent(applyMethodData.phoneNum)
103+
applyMethodData.phoneNum &&
104+
handleCopyContent(applyMethodData.phoneNum, 'contactInfo')
103105
}
104106
/>
105107
</div>

0 commit comments

Comments
 (0)