Replace EventLogger with typed AnalyticsManager using PostHog
Complete analytics overhaul: delete EventLogger.swift, create Analytics.swift with typed event enum (~45 events), screen tracking, super properties (theme, icon pack, voting layout, etc.), session replay with kill switch, autocapture, and network telemetry. Replace all 99 call sites across 38 files with compiler-enforced typed events in object_action naming convention. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -96,7 +96,7 @@ struct OnboardingSubscription: View {
|
||||
VStack(spacing: 12) {
|
||||
// Subscribe button
|
||||
Button(action: {
|
||||
EventLogger.log(event: "onboarding_subscribe_tapped")
|
||||
AnalyticsManager.shared.track(.onboardingSubscribeTapped)
|
||||
showSubscriptionStore = true
|
||||
}) {
|
||||
HStack {
|
||||
@@ -120,8 +120,8 @@ struct OnboardingSubscription: View {
|
||||
|
||||
// Skip button
|
||||
Button(action: {
|
||||
EventLogger.log(event: "onboarding_complete")
|
||||
EventLogger.log(event: "onboarding_skip_subscription")
|
||||
AnalyticsManager.shared.track(.onboardingCompleted(dayId: nil))
|
||||
AnalyticsManager.shared.track(.onboardingSkipped)
|
||||
completionClosure(onboardingData)
|
||||
}) {
|
||||
Text("Maybe Later")
|
||||
@@ -138,10 +138,10 @@ struct OnboardingSubscription: View {
|
||||
}
|
||||
.sheet(isPresented: $showSubscriptionStore, onDismiss: {
|
||||
// After subscription store closes, complete onboarding
|
||||
EventLogger.log(event: "onboarding_complete")
|
||||
AnalyticsManager.shared.track(.onboardingCompleted(dayId: nil))
|
||||
completionClosure(onboardingData)
|
||||
}) {
|
||||
FeelsSubscriptionStoreView()
|
||||
FeelsSubscriptionStoreView(source: "onboarding")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,9 +60,7 @@ struct OnboardingWrapup: View {
|
||||
.foregroundColor(Color(UIColor.white))
|
||||
|
||||
Button(action: {
|
||||
EventLogger.log(event: "onboarding_complete")
|
||||
EventLogger.log(event: "onboarding_complete_day_id",
|
||||
withData: ["id": onboardingData.inputDay.rawValue])
|
||||
AnalyticsManager.shared.track(.onboardingCompleted(dayId: String(onboardingData.inputDay.rawValue)))
|
||||
completionClosure(onboardingData)
|
||||
}, label: {
|
||||
Text(String(localized: "onboarding_wrap_up_complete_button"))
|
||||
|
||||
Reference in New Issue
Block a user