Skip to content

Commit

Permalink
Simplify tracking event properties code.
Browse files Browse the repository at this point in the history
  • Loading branch information
selanthiraiyan committed Jul 25, 2024
1 parent 2a81f1d commit c5aacd4
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ extension WooAnalyticsEvent {
static func generateDetailsTapped(isFirstAttempt: Bool,
features: String) -> WooAnalyticsEvent {
let wordCount = features.components(separatedBy: .whitespacesAndNewlines).count
let properties: [String: WooAnalyticsEventPropertyType?] = [Key.isFirstAttempt.rawValue: isFirstAttempt,
Key.featureWordCount.rawValue: wordCount]
return WooAnalyticsEvent(statName: .productCreationAIGenerateDetailsTapped,
properties: properties.compactMapValues { $0 })
properties: [Key.isFirstAttempt.rawValue: isFirstAttempt,
Key.featureWordCount.rawValue: wordCount])
}

static func generateProductDetailsSuccess() -> WooAnalyticsEvent {
Expand Down

0 comments on commit c5aacd4

Please sign in to comment.