[Feat] PostHog를 도입하고 analytics tracker 구조를 정리해요#500
Conversation
# Conflicts: # app/src/main/java/com/eatssu/android/presentation/MainViewModel.kt # app/src/main/java/com/eatssu/android/presentation/cafeteria/info/InfoBottomSheetFragment.kt
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 Pull Request는 앱의 분석 로깅 시스템을 현대화하고 확장성을 높이는 중요한 변경 사항을 포함합니다. 기존의 단일 Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
애널리틱스 추적 시스템을 타입 안전하고 확장 가능하게 리팩토링한 점이 인상적입니다. AnalyticsTracker 인터페이스를 중심으로 Firebase와 PostHog 구현을 분리하고, Hilt를 이용한 의존성 주입과 fan-out 구조를 깔끔하게 구현했습니다. 전반적으로 코드 품질이 크게 향상되었습니다.
한 가지 작은 수정 사항을 제안합니다. DaySelected 이벤트에서 요일 값을 기존 EventLogger와 동일한 축약형으로 보내도록 수정하여 데이터 일관성을 유지하는 것이 좋겠습니다. 이 부분을 제외하고는 로그인/로그아웃 시 사용자 식별, PostHog 디버그 설정 등 요청하신 사항들이 모두 의도대로 잘 구현된 것으로 보입니다.
There was a problem hiding this comment.
AnalyticsTracker를 PostHogAnalyticsTracker, FirebaseAnalyticsTracker가 상속받게 구현한게 OOP 스럽네요
core/common 말고 core/analytics 모듈로 분리하는것도 고려해봐도..? 좋을듯합니다
그리고 제가 생각했을때는 앱모듈에 analytics 관련 클래스가 너무 많아보여요. app 모듈이 아니라 feature 모듈로 나눠서 바꿨을때로 생각해도 현재 app 모듈에 있는 analytics 관련 클래스들이 feature모듈에 있을지 궁금합니다!
사실 저도 core/analytics로 처음엔 나눴다가 다시 돌렸었습니다... core에서는 android, posthog, firebase 등 외부 종속성에 영향 받지 않는 순수한 타입 선언 등만 넣으려고 했었기 때문이에요! 그런데 feature 모듈이라는 개념으로 app을 쪼개는 방향이라면, 당연히 feature 별로 나눌 것 같아요! app -> feature -> core |
@PeraSite 흐음 이건 저도 애매하다고 생각합니다. app에서 domain/data/presentation으로만 나눠도 괜찮을 것 같아요 |
infrastructure 라는 패키지를 추가해서 posthog, firebase 등... 완전한 외부 의존성을 분리하는 것도 좋아보여요! |
Summary
기존
EventLogger중심 호출을 typed analytics event + tracker fan-out 구조로 바꾸고, Firebase와 PostHog를 같은 진입점에서 처리하도록 정리했어요.core/common에AnalyticsEvent/AnalyticsTracker/AnalyticsIdentity모델을 추가했어요.app에서는DefaultAnalyticsTracker가 Firebase/PostHog로 fan-out 하도록 구성했어요../gradlew :app:testDebugUnitTest통과했어요.Describe your changes
core/commonEventLogger를 제거하고 typed analytics contract 및 payload/identity 모델을 추가했어요.app/analytics,app/diDefaultAnalyticsTracker,FirebaseAnalyticsTracker,PostHogAnalyticsTracker,AnalyticsIdentityManager를 추가했어요.presentation,domainBaseActivity/BaseFragment/IntroActivity/Map/Review/Widget등에서 새 tracker를 사용하도록 바꿨어요.app/src/testIssue
To reviewers
screen_view,app_launch,click_menu,write_review_v2같은 기존 이벤트가 새 typed event로 동일하게 전달되는지 봐주세요.