Skip to content

feat: GA 셋팅 - [TWI-76]#284

Merged
jihun32 merged 24 commits into
developfrom
feat/#281/TWI-76
May 12, 2026
Merged

feat: GA 셋팅 - [TWI-76]#284
jihun32 merged 24 commits into
developfrom
feat/#281/TWI-76

Conversation

@jihun32
Copy link
Copy Markdown
Contributor

@jihun32 jihun32 commented May 6, 2026

🔗 관련 이슈

📙 작업 내역

  • FirbaseAnalytics 의존성 추가
  • Core 계층 Analytics 모듈 생성
  • 로그인, 로그아웃 시 Analytics User 셋팅
  • 노션에 정의된 이벤트 심기

💬 추가 설명 or 리뷰 포인트 (선택)

  • 노션에 정린된 이벤트 관련해서 PM, 안드랑 논의해봐야할 거 같아서 논의 후 마저 작업하게씀

5.9

  • CoreAnalytics Event에서 Feature단을 알고 있는 구조라 protocol, Feature단에서 구현체 구현으로 책임 분리
  • 커밋에 이슈번호 잘못 달아서 281로 바꿨는데 내용은 똑같으니 하나만 보면 됨

@linear
Copy link
Copy Markdown

linear Bot commented May 6, 2026

TWI-76 [iOS] GA 셋팅

@clxxrlove clxxrlove added the feat label May 6, 2026
jihun32 pushed a commit that referenced this pull request May 9, 2026
- CoreAnalytics에서 Feature책임을 갖고있던 기존 구조에서 Evetn를 protocol로 추상화
- logEvent 클로저로 통합
jihun32 pushed a commit that referenced this pull request May 9, 2026
jihun32 pushed a commit that referenced this pull request May 9, 2026
jihun32 pushed a commit that referenced this pull request May 9, 2026
jihun32 pushed a commit that referenced this pull request May 9, 2026
jihun32 pushed a commit that referenced this pull request May 9, 2026
jihun32 pushed a commit that referenced this pull request May 9, 2026
jihun32 pushed a commit that referenced this pull request May 9, 2026
jihun32 pushed a commit that referenced this pull request May 9, 2026
@jihun32 jihun32 force-pushed the feat/#281/TWI-76 branch from fa84278 to 8cb15e8 Compare May 9, 2026 02:40
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 10, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: fb6110a3-e2c8-49d2-8095-7d45a071c8fa

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

워크스루

이 PR은 Google Analytics를 Keepiluv iOS 앱에 완전히 통합합니다. Firebase Analytics를 백엔드로 하는 재사용 가능한 분석 클라이언트를 생성하고, 인증, 홈 화면, 목표 상세보기, 온보딩, 통계 등 주요 기능에서 사용자 액션을 추적합니다.

변경 사항

Analytics 코어 모듈 및 통합

레이어 / 파일(s) 요약
모듈 정의 및 외부 의존성
Tuist/ProjectDescriptionHelpers/Module.swift, Tuist/ProjectDescriptionHelpers/Target/Dependency/TargetDependency+External.swift, Projects/Core/Analytics/Project.swift
Module.Core에 analytics 케이스 추가, FirebaseAnalytics 외부 의존성 등록, Analytics 모듈 4개 target(interface, implementation, testing, tests) 정의
Analytics 프로토콜 및 인터페이스
Projects/Core/Analytics/Interface/Sources/AnalyticsEvent.swift, Projects/Core/Analytics/Interface/Sources/AnalyticsClient.swift
AnalyticsEvent 프로토콜로 이벤트 계약 정의(name, parameters), AnalyticsClient 의존성 구조(setUserProfile, logEvent) 정의, TCA DependencyKey 통합
Firebase 구현
Projects/Core/Analytics/Sources/AnalyticsClient+Live.swift
AnalyticsClient를 Firebase Analytics로 구현, setUserProfile은 Firebase 사용자 ID/속성 설정, logEvent는 Firebase 이벤트 전달
앱 레벨 통합
Projects/App/Sources/Reducer/AppCoordinator.swift, Projects/App/Project.swift, Projects/Core/Push/Interface/Sources/NotificationDeepLink.swift
AppCoordinator에 analyticsClient 주입, 온보딩 완료 후 사용자 프로필 페칭 및 analytics에 설정, 로그아웃 시 프로필 초기화, NotificationDeepLink에 analyticsType 계산 속성 추가

Feature별 Analytics 이벤트 정의 및 로깅

레이어 / 파일(s) 요약
Feature 이벤트 정의
Projects/Feature/Auth/Sources/Analytics/AuthAnalyticsEvent.swift, Projects/Feature/GoalDetail/Sources/Analytics/GoalDetailAnalyticsEvent.swift, Projects/Feature/Home/Sources/Analytics/HomeAnalyticsEvent.swift, Projects/Feature/MainTab/Sources/Analytics/MainTabAnalyticsEvent.swift, Projects/Feature/MakeGoal/Sources/Analytics/MakeGoalAnalyticsEvent.swift, Projects/Feature/Onboarding/Sources/Analytics/OnboardingAnalyticsEvent.swift, Projects/Feature/ProofPhoto/Sources/Analytics/ProofPhotoAnalyticsEvent.swift, Projects/Feature/Stats/Sources/Analytics/StatsAnalyticsEvent.swift
각 feature에 맞춤형 AnalyticsEvent 구현: Auth(loginViewed), GoalDetail(pokeSent, emojiReactionSent), Home(recommendGoalClicked), MainTab(openedByPush), MakeGoal(created), Onboarding(inviteViewed, profileSetupViewed, anniversarySetupViewed, onboardingCompleted), ProofPhoto(uploaded), Stats(viewed)
Feature 프로젝트 의존성 설정
Projects/Feature/Auth/Project.swift, Projects/Feature/GoalDetail/Project.swift, Projects/Feature/Home/Project.swift, Projects/Feature/MainTab/Project.swift, Projects/Feature/MakeGoal/Project.swift, Projects/Feature/MakeGoal/Interface/Sources/GoalCategory.swift, Projects/Feature/Onboarding/Project.swift, Projects/Feature/ProofPhoto/Project.swift, Projects/Feature/Stats/Project.swift, Projects/Domain/Stats/Project.swift, Projects/Domain/Stats/Interface/Sources/StatsClient.swift
각 feature의 implements target에 analytics 인터페이스 의존성 추가, GoalCategory를 String 열거형으로 변경하여 category.rawValue 사용 가능하게 함
Reducer, Coordinator, View 로깅 구현
Projects/Feature/Auth/Sources/Reducer/AuthReducer.swift, Projects/Feature/Auth/Sources/View/AuthView.swift, Projects/Feature/GoalDetail/Sources/Detail/GoalDetailReducer+Impl.swift, Projects/Feature/Home/Sources/Home/HomeReducer+Impl.swift, Projects/Feature/MainTab/Sources/Reducer/MainTabReducer.swift, Projects/Feature/MakeGoal/Sources/MakeGoalReducer+Impl.swift, Projects/Feature/Onboarding/Sources/OnboardingCoordinator.swift, Projects/Feature/ProofPhoto/Sources/ProofPhoto/ProofPhotoReducer+Impl.swift, Projects/Feature/Stats/Sources/Stats/StatsReducer+Impl.swift
각 feature의 reducer/coordinator에서 analyticsClient 주입, 특정 사용자 액션(화면 표시, 버튼 탭, 동작 완료)에서 대응하는 analytics 이벤트 로깅, Onboarding에서는 loggedAnalyticsEvents로 중복 로깅 방지

🎯 코드 리뷰 난이도

🎯 3 (중간) | ⏱️ ~25분

관련 PR

제안 라벨

✨ feat

제안 검토자

  • clxxrlove
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#281/TWI-76

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

@jihun32 jihun32 marked this pull request as ready for review May 10, 2026 12:48
@clxxrlove
Copy link
Copy Markdown
Member

@coderabbitai summary

@github-actions github-actions Bot requested a review from clxxrlove May 10, 2026 12:48
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 10, 2026

✅ Actions performed

Summary regeneration triggered.

@dkswnkk
Copy link
Copy Markdown

dkswnkk commented May 10, 2026

@coderabbitai summary

뭔데 이게

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 10, 2026

Tip

For best results, initiate chat on the files or code changes.

@dkswnkk 안녕하세요! clxxrlove 님이 @coderabbitai summary 명령어를 사용하셔서 CodeRabbit이 이 PR의 AI 요약을 새로 생성한 것입니다. 😊

@coderabbitai summary 는 PR의 AI 요약을 재생성하도록 요청하는 CodeRabbit 명령어입니다. PR 설명이나 코드가 업데이트된 후 요약을 갱신하고 싶을 때 사용할 수 있습니다.

Copy link
Copy Markdown
Member

@clxxrlove clxxrlove left a comment

Choose a reason for hiding this comment

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

수고했어 ~~!
코멘트가 필수적인건 아니라 넘겨도 되는데
슬랙에 가은이한테 태그 관련해서 요청한 게 있는데 그거 대답 듣고 이후 마무리 하면 될듯

case let .uploaded(goalId, targetDate):
[
"goal_id": "\(goalId)",
"targetDate": targetDate
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

이거만 카멜케이스로 되어있네

Comment on lines +136 to +153
public var analyticsType: String {
switch self {
case .partnerConnected:
"partner_connected"
case .poke:
"poke"
case .goalCompleted:
"goal_completed"
case .reaction:
"reaction"
case .dailyGoalAchieved:
"daily_goal_achieved"
case .goalEnded:
"goal_ended"
case .marketing:
"marketing"
}
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

P4. 이건 개인적으로 이쪽 코어에 있는거보다는, MainTab쪽에서 매핑하는게 더 나을 거 같아 (Analytics랑 관심사가 다르니까)

// MainTabAnalyticsEvent.swift에서
case openedByPush(deepLink: NotificationDeepLink)

var parameters: [String: Any]? {
    case let .openedByPush(deepLink):
        let type: String
        switch deepLink {
        case .poke: type = "poke"
        ...
        }
        return ["type": type]
}

라던가, extension으로 추가한다거나 하는게 좋을듯

/// analyticsClient.logEvent(event)
/// ```
public struct AnalyticsClient {
public var setUserProfile: ((id: Int64?, name: String?)) -> Void
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

P5. 여기 파라미터는 타입 추론이나 이런 부분도 있고 해서 struct로 만드는게 어때?

@jihun32 jihun32 merged commit 3f76ddf into develop May 12, 2026
2 checks passed
@jihun32 jihun32 deleted the feat/#281/TWI-76 branch May 12, 2026 10:59
clxxrlove pushed a commit that referenced this pull request May 14, 2026
* feat: DomainCommon, FeatureCommon 모듈 생성 - #278

* refactor: 공통 타입들 DomainCommon, FeatureCommon으로 책임 분리 - #278

* refactor: common 분리에 영향받는 파일들 수정 - #278

* refactor: SharedDesignSystem에 있던 임시 TXItem 구현체 Feature에 맞게 분리 - #278

* refactor: TXItem 구현체 Feature분리에 따른 영향 범위 수정 - #278

* feat: CoreAnalytics 모듈 추가 - #281

* feat: AnalyticsClient, Event 구현 - #281
- draft로 올릴 예정이라 Event는 추후 추가 예정

* feat: 유져 로그인/로그아웃 시 Analytics user setting 하도록 구현 - #281

* feat: release일 때 analytics 동작하도록 구현 - #281

* refactor: CoreAnalytics 구조 개선 - #281
- CoreAnalytics에서 Feature책임을 갖고있던 기존 구조에서 Evetn를 protocol로 추상화
- logEvent 클로저로 통합

* feat: Auth 이벤트 심기 - #281

* feat: Onboarding 이벤트 심기 - #281

* feat: Home 이벤트 심기 - #281

* feat: MainTab 이벤트 심기 - #281

* feat: MakeGoal 이벤트 심기 - #281

* feat: GoalDetail 이벤트 심기 - #281

* feat: ProofPhoto 이벤트 심기 - #281

* feat: Stats 이벤트 심기 - #281

* docs: 누락된 주석 추가 - #281

* fix: 리뷰 반영 - #284

* feat: 추가 요청사항 인증샷 이벤트 심기 - #281

* fix: home 목표 생성 선택 이벤트 네이밍 수정  - #281

---------

Co-authored-by: jihun <jihun332@gmai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants