Skip to content

[feat] Posthog 이벤트 수정 및 신규 생성#527

Merged
chlwhdtn03 merged 5 commits into
developfrom
feat/posthog_event
May 23, 2026
Merged

[feat] Posthog 이벤트 수정 및 신규 생성#527
chlwhdtn03 merged 5 commits into
developfrom
feat/posthog_event

Conversation

@chlwhdtn03
Copy link
Copy Markdown
Collaborator

Summary

  • Posthog 이벤트 스키마를 노션에 맞게 수정했습니다
  • 앱 실행, 마이페이지, 팝업, 위젯, 리뷰이벤트의 전송 지점을 보완했습니다.

Describe your changes

  • app_launch에서 현재 설정 언어의 localeCode 전송
  • click_mypage_menu, popup_event 신규 추가
  • change_widget payload를 restaurant_before, restaurant_after로 변경
  • food_court, the_kitchen은 analytics restaurant payload에서 제외
  • write_review_v2, complete_review_v2에 restaurant 값 전달
  • 관련 analytics 테스트 및 ReviewViewModel 테스트 갱신

Issue

  • Resolves #

To reviewers

@chlwhdtn03 chlwhdtn03 requested a review from PeraSite May 22, 2026 08:00
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request expands analytics tracking across the application, including login, map interactions, My Page navigation, and home screen widgets. It also updates review events to include restaurant metadata and adds locale information to app launch logs. Review feedback identifies a bug where college and department IDs were swapped in an analytics event, and suggests improvements for code deduplication and consistent validation of widget IDs.

Comment on lines +73 to +79
val newDepartmentId = userCollegeDepartment.userDepartment.departmentId.toLong()
val newCollegeId = userCollegeDepartment.userCollege.collegeId.toLong()

analyticsTracker.track(
ClickPlzNotMeEvent(
college = newDepartmentId,
major = newCollegeId,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The parameters for ClickPlzNotMeEvent appear to be swapped. newDepartmentId is being passed to college and newCollegeId to major, which contradicts their names and the pattern used in trackMyPageMenu.

Suggested change
val newDepartmentId = userCollegeDepartment.userDepartment.departmentId.toLong()
val newCollegeId = userCollegeDepartment.userCollege.collegeId.toLong()
analyticsTracker.track(
ClickPlzNotMeEvent(
college = newDepartmentId,
major = newCollegeId,
val collegeId = userCollegeDepartment.userCollege.collegeId.toLong()
val departmentId = userCollegeDepartment.userDepartment.departmentId.toLong()
analyticsTracker.track(
ClickPlzNotMeEvent(
college = collegeId,
major = departmentId,
),
)

Comment on lines +69 to +71
val fileKey =
appWidgetId?.takeIf { it != AppWidgetManager.INVALID_APPWIDGET_ID }
?.let { "appWidget-$it" }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The logic for generating the fileKey is repeated in multiple places. Consider creating a private helper function or a constant to ensure consistency and reduce duplication.

}

lifecycleScope.launch {
val fileKey = "appWidget-$appWidgetId"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

In onConfirm, appWidgetId is used directly without checking if it is AppWidgetManager.INVALID_APPWIDGET_ID, unlike the logic in LaunchedEffect. It's safer to use the same validation logic here.

@chlwhdtn03 chlwhdtn03 merged commit 96b90c9 into develop May 23, 2026
3 of 4 checks passed
@chlwhdtn03 chlwhdtn03 deleted the feat/posthog_event branch May 23, 2026 13:28
@chlwhdtn03 chlwhdtn03 mentioned this pull request May 23, 2026
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.

1 participant