Skip to content

Analytics

LaunchSwift includes an analytics abstraction and TelemetryDeck integration types in Core/Analytics.

  • ios/SwiftLaunch/Core/Analytics/AnalyticsEvent.swift — event enum + event name/parameter mapping
  • ios/SwiftLaunch/Core/Analytics/AnalyticsService.swift — protocol and concrete implementations
protocol AnalyticsServiceProtocol: Sendable {
func track(event: AnalyticsEvent)
}
struct NoOpAnalyticsService: AnalyticsServiceProtocol { ... }
struct TelemetryDeckAnalyticsService: AnalyticsServiceProtocol { ... }

TelemetryDeckAnalyticsService initializes TelemetryDeck in init(appID:) and sends events via TelemetryDeck.signal.

enum AnalyticsEvent: Sendable {
case appLaunched
case onboardingCompleted
case onboardingSkipped
case authSignedIn(method: String)
case authSignedOut
case paywallViewed
case purchaseCompleted(product: String)
case purchaseRestored
case aiMessageSent(model: String)
case aiConversationCleared
case settingsViewed
case languageChanged(to: String)
}

Each case maps to a stable name and optional parameters dictionary in AnalyticsEvent.swift.

  • AppConfig.swift does not define a telemetryDeckAppID property.
  • LaunchSwiftApp.swift does not currently instantiate or inject an analytics service.
  • There is no analytics EnvironmentKey helper in the current codebase.

So today, analytics primitives are present, but app-wide injection/event wiring is not yet implemented in production app flow code.

let analytics: any AnalyticsServiceProtocol =
TelemetryDeckAnalyticsService(appID: "YOUR-TELEMETRYDECK-APP-ID")
analytics.track(event: .appLaunched)
analytics.track(event: .authSignedIn(method: "apple"))