You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
src/components/poll/regist/PollRegistButton/PollRegistButton.tsx/ReactGA 이벤트 호출 위치 문제
onSuccess 콜백 내에서 ReactGA.event를 호출하는데, myInfo?.onboardingStep이 존재할 때만 호출되고 있음. 만약 myInfo가 없거나 onboardingStep이 없으면 이벤트가 누락될 수 있음. 이벤트 로깅은 투표 등록 성공 시 무조건 실행하는 게 더 명확하고 안전함.
→ ReactGA.event 호출을 myInfo?.onboardingStep 조건문 밖으로 빼서, 성공 시 항상 이벤트가 기록되도록 개선 권장.
src/components/poll/regist/PollRegistButton/PollRegistButton.tsx/ReactGA 이벤트 파라미터 명세
ReactGA.event 호출 시 이벤트 이름을 문자열 'poll_created'로 직접 넘기고 있는데, GA4 권장 방식은 이벤트 이름과 파라미터를 객체 형태로 넘기는 것임. 또한 post_id 대신 camelCase인 postId를 사용하는 것이 일반적임.
→ ReactGA.event({ action: 'poll_created', params: { postId: data.postId } }) 형태로 호출하거나, 라이브러리 문서에 맞게 이벤트 명세를 통일할 것.
src/components/poll/regist/PollRegistButton/PollRegistButton.tsx/ReactGA import 위치 및 사용법
ReactGA를 import 했지만, 초기화(ReactGA.initialize) 코드가 보이지 않음. GA4는 초기화가 필수이며, 초기화가 안 된 상태에서 이벤트를 보내면 무시될 수 있음.
→ GA 초기화가 앱 진입점에서 제대로 되어있는지 확인하고, 없다면 초기화 코드를 추가할 것.
nit
ReactGA.event 호출 시 이벤트 이름과 파라미터를 한 줄에 작성하면 가독성이 더 좋아질 수 있음.
updateOnboarding 주석 "너무 길어지는 것 방지용"은 좀 더 구체적으로 어떤 의도인지 명시하면 좋음.
import 순서를 외부 라이브러리 → 내부 훅 → 컴포넌트 순으로 정리하면 유지보수에 도움됨.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Modification
Result
X