-
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
Conversation
📲 You can test the changes from this Pull Request in WooCommerce iOS by scanning the QR code below to install the corresponding build.
|
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.
This works as expected! I left some suggestions for improvements, please feel free to merge after checking them out.
properties: [Key.isFirstAttempt.rawValue: isFirstAttempt]) | ||
static func generateDetailsTapped(isFirstAttempt: Bool, | ||
features: String) -> WooAnalyticsEvent { | ||
let wordCount = features.split { $0 == " " || $0.isNewline }.count |
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:)
:
let wordCount = features.split { $0 == " " || $0.isNewline }.count | |
let wordCount = features.components(separatedBy: .whitespacesAndNewlines).count |
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
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 comment
The reason will be displayed to describe this comment to others. Learn more.
❓ I wonder why the values have to be optional. We can replace WooAnalyticsEventPropertyType?
with any WooAnalyticsEventPropertyType
instead, right?
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.
Good question. I earlier kept the features
as an optional parameter, and I missed updating it again.
Simplified code in c5aacd4
Part of: #13118
Description
Starts tracking the number of words entered in the "Starting Information" screen.
Internal - p1721819695107559/1721819689.954159-slack-C03L1NF1EA3
Steps to reproduce
feature_word_count
should reflect the number of words entered in the text field.product_creation_ai_generate_details_tapped
event is tracked again with thefeature_word_count
property.Screenshots
RELEASE-NOTES.txt
if necessary.