-
Notifications
You must be signed in to change notification settings - Fork 1
feat : GA4 trackedpage 추가 및 click 이벤트 할당 (정준영 part) #219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The head ref may contain hidden characters: "feature/Ga4-trackedpage-\uCD94\uAC00-\uBC0F-click-\uC774\uBCA4\uD2B8-\uD560\uB2F9-\uC815\uC900\uC601"
Changes from 9 commits
e24c89d
bc90ce4
fa83330
b85940f
c9c9fc6
9bb58bf
269cc35
5530b4b
2dba05c
72a66df
434ffc7
b20fe56
950832a
1730734
0f7c186
de086e4
1b317cf
46e208e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ import { SetStateAction } from "react"; | |
| import { useNavigate } from "react-router-dom"; | ||
| import { authInstance } from "@/api/axios"; | ||
| import { VirtualFriend } from "@/types/virtualFreind"; | ||
| import trackClickEvent from "@/utils/trackClickEvent"; | ||
|
|
||
| interface ProfileProps { | ||
| info: VirtualFriend; | ||
|
|
@@ -12,6 +13,7 @@ const Profile = ({ info, deleteIndex, setVirtualFriendList }: ProfileProps) => { | |
| const navigate = useNavigate(); | ||
|
|
||
| const handleDelete = async () => { | ||
| trackClickEvent("홈", "친구 - 삭제하기 버튼"); | ||
| const res = await authInstance.delete( | ||
| `/api/virtual-friend/${info.virtualFriendId}` | ||
| ); | ||
|
|
@@ -23,6 +25,7 @@ const Profile = ({ info, deleteIndex, setVirtualFriendList }: ProfileProps) => { | |
| }; | ||
|
|
||
| const handleNavigate = () => { | ||
| trackClickEvent("홈", "친구 - 대화 시작하기 버튼"); | ||
|
||
| navigate("/chat", { | ||
| state: { | ||
| mode: "virtualFriend", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,22 @@ | ||
| import { useNavigate } from "react-router-dom"; | ||
| import trackClickEvent from "@/utils/trackClickEvent"; | ||
|
|
||
| const RestartButton = () => { | ||
| const navigate = useNavigate(); | ||
| const navigate = useNavigate(); | ||
|
|
||
| const goFirstStep = () => { | ||
| navigate("/mbti-test"); | ||
| } | ||
| const goFirstStep = () => { | ||
| trackClickEvent("/MBTI 테스트 결과", "돌아가기 버튼"); | ||
|
||
| navigate("/mbti-test"); | ||
| }; | ||
|
|
||
| return ( | ||
| <button className="flex justify-center items-center bg-gray-100 rounded-lg w-[72px] h-[60px]" onClick={goFirstStep}> | ||
| <img src="/icon/restart.svg" alt="다시하기 버튼" width={24} height={24} /> | ||
| </button> | ||
| ) | ||
| } | ||
| return ( | ||
| <button | ||
| className="flex h-[60px] w-[72px] items-center justify-center rounded-lg bg-gray-100" | ||
| onClick={goFirstStep} | ||
| > | ||
| <img src="/icon/restart.svg" alt="다시하기 버튼" width={24} height={24} /> | ||
| </button> | ||
| ); | ||
| }; | ||
|
|
||
| export default RestartButton; | ||
| export default RestartButton; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import { trackEvent } from "@/libs/analytics"; | ||
|
|
||
| const trackClickEvent = (page: string, element: string) => { | ||
| trackEvent("Click", { | ||
| page: page, | ||
| element: element | ||
| }); | ||
| }; | ||
|
|
||
| export default trackClickEvent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기를 포함해서 page 값이 지운님이 설정해주신 값들과 다른 것 같은데 혹시 따로 업데이트 된 사항일까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
흠... 제가 이해를 잘못했네요! 설정해주신대로 다시 수정하겠습니다!