Skip to content

Commit 07ce1c3

Browse files
committed
feat: PA 로그 추가
1 parent b9cd8de commit 07ce1c3

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

src/layouts/HomeLayout.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { logAnalytics } from "@/utils/log"
12
import LogoImage from "@assets/icons/home-logo.svg?react"
23
import { Outlet } from "react-router-dom"
34

@@ -7,6 +8,9 @@ const LOGIN_LINK = `https://kauth.kakao.com/oauth/authorize?client_id=${REST_API
78

89
const HomeLayout: React.FC = () => {
910
const loginHandler = (): void => {
11+
logAnalytics("click_login_button", {
12+
from: "header",
13+
})
1014
window.location.href = LOGIN_LINK
1115
}
1216

src/pages/HomePage.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,17 @@ const HomePage: React.FC = () => {
2222
const navigate = useNavigate()
2323
const { setIsExperiencing } = useExperiencingStore()
2424
const loginHandler = (): void => {
25+
logAnalytics("click_login_button", {
26+
from: "main",
27+
})
2528
window.location.href = LOGIN_LINK
2629
}
2730

28-
const shareLinkHandler = async (): Promise<void> => {
31+
const shareLinkHandler = async (element: string): Promise<void> => {
2932
try {
33+
logAnalytics("click_shared_link", {
34+
from: element,
35+
})
3036
await navigator.share(SHARE_DATA)
3137
console.log("공유 성공")
3238
} catch (e) {
@@ -36,6 +42,7 @@ const HomePage: React.FC = () => {
3642

3743
const experiencingHandler = (): void => {
3844
setIsExperiencing(true)
45+
logAnalytics("click_experience_button")
3946
navigate(RoutePath.MONITORING)
4047
}
4148

@@ -47,7 +54,7 @@ const HomePage: React.FC = () => {
4754
<>
4855
<button
4956
className="fixed bottom-0 left-0 z-10 flex w-full items-center justify-center bg-[#1A75FF] py-[22px] lg:hidden"
50-
onClick={shareLinkHandler}
57+
onClick={() => shareLinkHandler("sticky-button")}
5158
>
5259
<span className="text-[17px] font-semibold leading-[24px] text-white">링크 공유하기</span>
5360
</button>
@@ -101,7 +108,7 @@ const HomePage: React.FC = () => {
101108
</div>
102109
<div className="text-zic-500 text-center text-[13px] font-medium leading-[20px]">
103110
웹에서도 빠르게 써보려면?!{" "}
104-
<button className="hover:underline" onClick={shareLinkHandler}>
111+
<button className="hover:underline" onClick={() => shareLinkHandler("link-share-text")}>
105112
‘링크 공유하기'
106113
</button>{" "}
107114
클릭
@@ -168,7 +175,7 @@ const HomePage: React.FC = () => {
168175
</div>
169176
<button
170177
className="mt-[60px] flex h-[54px] w-[220px] items-center justify-center rounded-full bg-white px-6 py-3 text-[16px] leading-[24px]"
171-
onClick={shareLinkHandler}
178+
onClick={() => shareLinkHandler("bottom-share-button")}
172179
>
173180
<Share2 className="mr-2" size={16} />
174181
<span className="text-[16px] font-semibold leading-[24px] text-zinc-900">링크 공유하기</span>

0 commit comments

Comments
 (0)