diff --git a/MealMood/Services/AnalyticsService.swift b/MealMood/Services/AnalyticsService.swift index 5394799..df87efc 100644 --- a/MealMood/Services/AnalyticsService.swift +++ b/MealMood/Services/AnalyticsService.swift @@ -107,8 +107,21 @@ enum AnalyticsService { logEvent(AnalyticsEvent.onboardingCompleted, parameters: ["dish_count": dishCount]) } + // Human-readable names for each onboarding step, indexed by step number. + // Keep in sync with the OnboardingView step order. + private static let onboardingStepNames = [ + "0_welcome", "1_meal_windows", "2_weekends", + "3_calendar", "4_first_dishes", "5_paywall" + ] + static func logOnboardingStepViewed(step: Int) { - logEvent(AnalyticsEvent.onboardingStepViewed, parameters: ["step": step]) + // GA4 text custom dimensions do not capture numeric params (they show as + // "(not set)"). Log the step as a String so the drop-off is queryable. + let name = step >= 0 && step < onboardingStepNames.count ? onboardingStepNames[step] : "\(step)" + logEvent(AnalyticsEvent.onboardingStepViewed, parameters: [ + "step": "\(step)", + "step_name": name + ]) } static func logAutoAssignUsed(filledSlots: Int, unfilledSlots: Int) {