-
Notifications
You must be signed in to change notification settings - Fork 0
[#453] Firebase Analytics를 적용한다 #498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
08a2cd3
feat: FirebaseAnalyticsCore 의존성 추가
opficdev e0819d8
feat: Analytics 계층 구성
opficdev ba67ab6
feat: 화면 분석 연결
opficdev 29cf7c7
feat: 생성 이벤트 및 Todo 완료 분석 연결
opficdev 55fc989
feat: 푸시 오픈 분석 연결
opficdev e207364
test: 웹페이지 삭제 테스트 보정
opficdev d42914a
chore: 자동 화면 추적 비활성화
opficdev df098a1
refactor: handler에 MainActor 추가
opficdev 3acf52c
refactor: handler에서 MainActor 제거
opficdev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
22 changes: 22 additions & 0 deletions
22
Application/DevLogApp/Sources/App/Handler/PushNotificationOpenHandler.swift
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| // | ||
| // PushNotificationOpenHandler.swift | ||
| // DevLog | ||
| // | ||
| // Created by opfic on 5/28/26. | ||
| // | ||
|
|
||
| import Foundation | ||
| import DevLogDomain | ||
|
|
||
| final class PushNotificationOpenHandler { | ||
| private let trackAnalyticsEventUseCase: TrackAnalyticsEventUseCase | ||
|
|
||
| init(trackAnalyticsEventUseCase: TrackAnalyticsEventUseCase) { | ||
| self.trackAnalyticsEventUseCase = trackAnalyticsEventUseCase | ||
| } | ||
|
|
||
| func handlePushOpen(userInfo: [AnyHashable: Any]) { | ||
| trackAnalyticsEventUseCase.execute(.pushOpen) | ||
| PushNotificationRoute.shared.handlePushTap(userInfo: userInfo) | ||
| } | ||
| } | ||
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
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
14 changes: 14 additions & 0 deletions
14
Application/DevLogData/Sources/Protocol/AnalyticsService.swift
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // | ||
| // AnalyticsService.swift | ||
| // DevLogData | ||
| // | ||
| // Created by opfic on 5/27/26. | ||
| // | ||
|
|
||
| public protocol AnalyticsService { | ||
| func trackScreenView(_ name: String) | ||
| func trackTodoCreate() | ||
| func trackTodoComplete() | ||
| func trackWebPageCreate() | ||
| func trackPushOpen() | ||
| } |
31 changes: 31 additions & 0 deletions
31
Application/DevLogData/Sources/Repository/AnalyticsRepositoryImpl.swift
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| // | ||
| // AnalyticsRepositoryImpl.swift | ||
| // DevLogData | ||
| // | ||
| // Created by opfic on 5/27/26. | ||
| // | ||
|
|
||
| import DevLogDomain | ||
|
|
||
| final class AnalyticsRepositoryImpl: AnalyticsRepository { | ||
| private let analyticsService: AnalyticsService | ||
|
|
||
| init(analyticsService: AnalyticsService) { | ||
| self.analyticsService = analyticsService | ||
| } | ||
|
|
||
| func track(_ event: AnalyticsEvent) { | ||
| switch event { | ||
| case .screenView(let name): | ||
| analyticsService.trackScreenView(name) | ||
| case .todoCreate: | ||
| analyticsService.trackTodoCreate() | ||
| case .todoComplete: | ||
| analyticsService.trackTodoComplete() | ||
| case .webPageCreate: | ||
| analyticsService.trackWebPageCreate() | ||
| case .pushOpen: | ||
| analyticsService.trackPushOpen() | ||
| } | ||
| } | ||
| } |
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
14 changes: 14 additions & 0 deletions
14
Application/DevLogDomain/Sources/Entity/AnalyticsEvent.swift
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // | ||
| // AnalyticsEvent.swift | ||
| // DevLogDomain | ||
| // | ||
| // Created by opfic on 5/28/26. | ||
| // | ||
|
|
||
| public enum AnalyticsEvent { | ||
| case screenView(String) | ||
| case todoCreate | ||
| case todoComplete | ||
| case webPageCreate | ||
| case pushOpen | ||
| } |
10 changes: 10 additions & 0 deletions
10
Application/DevLogDomain/Sources/Protocol/AnalyticsRepository.swift
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| // | ||
| // AnalyticsRepository.swift | ||
| // DevLogDomain | ||
| // | ||
| // Created by opfic on 5/27/26. | ||
| // | ||
|
|
||
| public protocol AnalyticsRepository { | ||
| func track(_ event: AnalyticsEvent) | ||
| } |
10 changes: 10 additions & 0 deletions
10
Application/DevLogDomain/Sources/UseCase/Analytics/TrackAnalyticsEventUseCase.swift
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| // | ||
| // TrackAnalyticsEventUseCase.swift | ||
| // DevLogDomain | ||
| // | ||
| // Created by opfic on 5/27/26. | ||
| // | ||
|
|
||
| public protocol TrackAnalyticsEventUseCase { | ||
| func execute(_ event: AnalyticsEvent) | ||
| } |
18 changes: 18 additions & 0 deletions
18
Application/DevLogDomain/Sources/UseCase/Analytics/TrackAnalyticsEventUseCaseImpl.swift
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| // | ||
| // TrackAnalyticsEventUseCaseImpl.swift | ||
| // DevLogDomain | ||
| // | ||
| // Created by opfic on 5/27/26. | ||
| // | ||
|
|
||
| public final class TrackAnalyticsEventUseCaseImpl: TrackAnalyticsEventUseCase { | ||
| private let repository: AnalyticsRepository | ||
|
|
||
| init(_ repository: AnalyticsRepository) { | ||
| self.repository = repository | ||
| } | ||
|
|
||
| public func execute(_ event: AnalyticsEvent) { | ||
| repository.track(event) | ||
| } | ||
| } |
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
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
43 changes: 43 additions & 0 deletions
43
Application/DevLogInfra/Sources/Service/FirebaseAnalyticsServiceImpl.swift
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| // | ||
| // FirebaseAnalyticsServiceImpl.swift | ||
| // DevLogInfra | ||
| // | ||
| // Created by opfic on 5/27/26. | ||
| // | ||
|
|
||
| import DevLogData | ||
| import FirebaseAnalytics | ||
|
|
||
| final class FirebaseAnalyticsServiceImpl: AnalyticsService { | ||
| private enum EventName { | ||
| static let todoCreate = "todo_create" | ||
| static let todoComplete = "todo_complete" | ||
| static let webPageCreate = "webpage_create" | ||
| static let pushOpen = "push_open" | ||
| } | ||
|
|
||
| func trackScreenView(_ name: String) { | ||
| Analytics.logEvent( | ||
| AnalyticsEventScreenView, | ||
| parameters: [ | ||
| AnalyticsParameterScreenName: name, | ||
| ] | ||
| ) | ||
| } | ||
|
|
||
| func trackTodoCreate() { | ||
| Analytics.logEvent(EventName.todoCreate, parameters: nil) | ||
| } | ||
|
|
||
| func trackTodoComplete() { | ||
| Analytics.logEvent(EventName.todoComplete, parameters: nil) | ||
| } | ||
|
|
||
| func trackWebPageCreate() { | ||
| Analytics.logEvent(EventName.webPageCreate, parameters: nil) | ||
| } | ||
|
|
||
| func trackPushOpen() { | ||
| Analytics.logEvent(EventName.pushOpen, parameters: nil) | ||
| } | ||
| } |
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.