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
fix: amplitude - 사용자가 알림 상세 화면을 조회할 때
NotificationDetailViewModel에서 푸시 / 알림 들어온 경로 확인이 불가하기 때문에, Coordinator로 amplitude 수정
  • Loading branch information
seungchan2 committed Dec 12, 2024
commit bc07d3a6d85817c838d4a638db176c2813941860
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ final class NotificationCoordinator: DefaultNotificationCoordinator {
let url = link.url

let destination: NotificationCoordinatorDestination = link.isDeepLink ? .deepLink(url: url) : .webLink(url: url)
AmplitudeInstance.shared.track(eventType: .viewNotificationDetail, eventProperties: [
"notification_id": notificationId,
"open_method": link.isDeepLink ? "푸시알림" : "알림센터",
"contain_deeplink": link.isDeepLink
])

self?.requestCoordinating?(destination)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ 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 @@ -122,16 +121,6 @@ extension NotificationDetailViewModel {
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