-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Product Creation AI] Tracking for M3 #13411
Changes from 2 commits
fd60189
a4e5242
d015039
2a81f1d
c5aacd4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import Foundation | ||
import WooFoundation | ||
|
||
extension WooAnalyticsEvent { | ||
enum ProductCreationAI { | ||
|
@@ -10,6 +11,7 @@ extension WooAnalyticsEvent { | |
case shortDescription = "short_description" | ||
case description | ||
case field | ||
case featureWordCount = "feature_word_count" | ||
} | ||
|
||
static func entryPointDisplayed() -> WooAnalyticsEvent { | ||
|
@@ -32,9 +34,13 @@ extension WooAnalyticsEvent { | |
properties: [Key.value.rawValue: tone.rawValue.lowercased()]) | ||
} | ||
|
||
static func generateDetailsTapped(isFirstAttempt: Bool) -> WooAnalyticsEvent { | ||
WooAnalyticsEvent(statName: .productCreationAIGenerateDetailsTapped, | ||
properties: [Key.isFirstAttempt.rawValue: isFirstAttempt]) | ||
static func generateDetailsTapped(isFirstAttempt: Bool, | ||
features: String) -> WooAnalyticsEvent { | ||
let wordCount = features.split { $0 == " " || $0.isNewline }.count | ||
let properties: [String: WooAnalyticsEventPropertyType?] = [Key.isFirstAttempt.rawValue: isFirstAttempt, | ||
Key.featureWordCount.rawValue: wordCount] | ||
return WooAnalyticsEvent(statName: .productCreationAIGenerateDetailsTapped, | ||
properties: properties.compactMapValues { $0 }) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❓ I wonder why the values have to be optional. We can replace There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good question. I earlier kept the Simplified code in c5aacd4 |
||
} | ||
|
||
static func generateProductDetailsSuccess() -> WooAnalyticsEvent { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: this can be simplified using
components(separatedBy:)
:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion, Huong! Done in 2a81f1d