UTM Campaign 파라미터를 Analytics에 설정된 파라미터 상수값 사용
This commit is contained in:
parent
e83164ded5
commit
2626245e6d
|
@ -94,20 +94,28 @@ struct SplashView: View {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.7) {
|
||||
withAnimation {
|
||||
if AppState.shared.pushRoomId > 0 {
|
||||
liveViewModel.enterLiveRoom(roomId: AppState.shared.pushRoomId)
|
||||
} else if AppState.shared.pushChannelId > 0 {
|
||||
AppState.shared.setAppStep(step: .creatorDetail(userId: AppState.shared.pushChannelId))
|
||||
} else if AppState.shared.pushAudioContentId > 0 {
|
||||
AppState.shared.setAppStep(step: .contentDetail(contentId: AppState.shared.pushAudioContentId))
|
||||
} else if AppState.shared.pushSeriesId > 0 {
|
||||
AppState.shared.setAppStep(step: .seriesDetail(seriesId: AppState.shared.pushSeriesId))
|
||||
} else {
|
||||
AppState.shared.setAppStep(step: .main)
|
||||
}
|
||||
nextAppStep()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func nextAppStep() {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.7) {
|
||||
withAnimation {
|
||||
if !UserDefaults.string(forKey: UserDefaultsKey.token).trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
||||
if AppState.shared.pushRoomId > 0 {
|
||||
liveViewModel.enterLiveRoom(roomId: AppState.shared.pushRoomId)
|
||||
} else if AppState.shared.pushChannelId > 0 {
|
||||
AppState.shared.setAppStep(step: .creatorDetail(userId: AppState.shared.pushChannelId))
|
||||
} else if AppState.shared.pushAudioContentId > 0 {
|
||||
AppState.shared.setAppStep(step: .contentDetail(contentId: AppState.shared.pushAudioContentId))
|
||||
} else if AppState.shared.pushSeriesId > 0 {
|
||||
AppState.shared.setAppStep(step: .seriesDetail(seriesId: AppState.shared.pushSeriesId))
|
||||
} else {
|
||||
AppState.shared.setAppStep(step: .main)
|
||||
}
|
||||
} else {
|
||||
AppState.shared.setAppStep(step: .main)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -133,34 +141,10 @@ struct SplashView: View {
|
|||
} else if latestMajor == major && latestMinor == minor && latestPatch > patch {
|
||||
self.isShowUpdatePopup = true
|
||||
} else {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.7) {
|
||||
withAnimation {
|
||||
if AppState.shared.pushRoomId > 0 {
|
||||
liveViewModel.enterLiveRoom(roomId: AppState.shared.pushRoomId)
|
||||
} else if AppState.shared.pushChannelId > 0 {
|
||||
AppState.shared.setAppStep(step: .creatorDetail(userId: AppState.shared.pushChannelId))
|
||||
} else if AppState.shared.pushAudioContentId > 0 {
|
||||
AppState.shared.setAppStep(step: .contentDetail(contentId: AppState.shared.pushAudioContentId))
|
||||
} else {
|
||||
AppState.shared.setAppStep(step: .main)
|
||||
}
|
||||
}
|
||||
}
|
||||
nextAppStep()
|
||||
}
|
||||
} else {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.7) {
|
||||
withAnimation {
|
||||
if AppState.shared.pushRoomId > 0 {
|
||||
liveViewModel.enterLiveRoom(roomId: AppState.shared.pushRoomId)
|
||||
} else if AppState.shared.pushChannelId > 0 {
|
||||
AppState.shared.setAppStep(step: .creatorDetail(userId: AppState.shared.pushChannelId))
|
||||
} else if AppState.shared.pushAudioContentId > 0 {
|
||||
AppState.shared.setAppStep(step: .contentDetail(contentId: AppState.shared.pushAudioContentId))
|
||||
} else {
|
||||
AppState.shared.setAppStep(step: .main)
|
||||
}
|
||||
}
|
||||
}
|
||||
nextAppStep()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,10 +24,10 @@ class FirebaseTracking {
|
|||
let utmCampaign = AppState.shared.marketingUtmCampaign.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
|
||||
if !utmSource.isEmpty && !utmMedium.isEmpty && !utmCampaign.isEmpty {
|
||||
Analytics.logEvent("campaign_utm", parameters: [
|
||||
"utm_source": utmSource,
|
||||
"utm_medium": utmMedium,
|
||||
"utm_campaign": utmCampaign
|
||||
Analytics.logEvent(AnalyticsEventCampaignDetails, parameters: [
|
||||
AnalyticsParameterSource: utmSource,
|
||||
AnalyticsParameterMedium: utmMedium,
|
||||
AnalyticsParameterCampaign: utmCampaign
|
||||
])
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue