Skip to content

첫 투표 생성 시 ga 이벤트를 발생시킨다.#490

Merged
Jeongchanyeong merged 1 commit intodevelopfrom
feature/ga-poll-created-event
Dec 19, 2025
Merged

첫 투표 생성 시 ga 이벤트를 발생시킨다.#490
Jeongchanyeong merged 1 commit intodevelopfrom
feature/ga-poll-created-event

Conversation

@YOOJS1205
Copy link
Contributor

Motivation

  • 첫 투표 생성 시 ga 이벤트를 발생시킨다.
Reference Links
Issue

Modification

  • FIRST_STEP가 true일 때 트리거하도록 로직 추가

Result

X


@github-actions
Copy link

🤖 AI Code Review (OpenAI)

  • 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 순서를 외부 라이브러리 → 내부 훅 → 컴포넌트 순으로 정리하면 유지보수에 도움됨.

자동 생성된 리뷰입니다. 참고용으로만 사용해주세요.

@Jeongchanyeong Jeongchanyeong merged commit 1b45c8b into develop Dec 19, 2025
6 checks passed
@Jeongchanyeong Jeongchanyeong deleted the feature/ga-poll-created-event branch December 19, 2025 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants