2.0: analytics — log onboarding step as String + step_name for GA4 drop-off
GA4 text custom dimensions do not capture numeric params (step showed as "(not set)"). Log step as String and add a readable step_name so the onboarding drop-off is queryable. Registered source/environment/step_name custom dimensions in the GA4 property to match. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Df9kZEUMXPLn4Kb9Zx1f5o
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user