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 88677dd02c3e8efd072c461b2a2592806746e2cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public enum AmplitudeEventType: String {
case clickFaq = "click_faq"
case clickPlaygroundCommunity = "click_playground_community"
case clickHotboard = "click_hotboard"
case clickShortcutButton = "click_link.btn"
case clickReadAllButton = "click_allread.btn"

// 콕 찌르기 클릭 이벤트
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ extension NotificationDetailViewModel {
.sink { owner, _ in
guard let shortCutLink = owner.makeShortCutLink() else { return }
owner.onShortCutButtonTap?(shortCutLink)
owner.trackAmplitudeShortcutButtonTapped(with: owner.notificationId)
}.store(in: cancelBag)

return output
Expand Down Expand Up @@ -119,4 +120,7 @@ extension NotificationDetailViewModel {
let calendar = Calendar.current
return calendar.isDateInToday(date)
}
private func trackAmplitudeShortcutButtonTapped(with notificationId: String) {
AmplitudeInstance.shared.track(eventType: .clickShortcutButton, eventProperties: ["notification_id": notificationId])
}
}