Skip to content
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

[Feat] #408 - Amplitude 설치 #462

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Prev Previous commit
Next Next commit
feat: amplitude - 알림 상세 조회할 때
  • Loading branch information
seungchan2 committed Dec 12, 2024
commit 2fa9159da38e87fbe78840e1ed6d1022658ec318
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public enum AmplitudeEventType: String {
// 뷰 이벤트
case viewAppHome = "view_apphome"
case viewPokeOnboarding = "view_poke_onboarding"
case viewNotificationDetail = "view_notification_detail"

// 콕 찌르기 뷰 이벤트
case viewPokeMain = "view_poke_main"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ extension NotificationDetailViewModel {
.withUnretained(self)
.sink { owner, _ in
owner.useCase.getNotificationDetail(notificationId: owner.notificationId)
owner.trackAmplitudeNoticeDetailView(with: owner.notificationId)
}.store(in: cancelBag)

input.shortCutButtonTap
Expand Down Expand Up @@ -120,6 +121,17 @@ extension NotificationDetailViewModel {
let calendar = Calendar.current
return calendar.isDateInToday(date)
}

private func trackAmplitudeNoticeDetailView(with notificationId: String) {
guard let notification else { return }
AmplitudeInstance.shared.track(eventType: .viewNotificationDetail,
eventProperties: [
"notification_id": notificationId,
"open_method": notification.hasDeepLink ? "푸시" : "알림센터",
"contain_deeplink": notification.hasDeepLink
])
}

private func trackAmplitudeShortcutButtonTapped(with notificationId: String) {
AmplitudeInstance.shared.track(eventType: .clickShortcutButton, eventProperties: ["notification_id": notificationId])
}
Expand Down