Skip to content
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

Merged
merged 5 commits into from
Jul 25, 2024
Merged

Conversation

selanthiraiyan
Copy link
Contributor

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

  • Login into a store eligible for Jetpack AI
  • Start the AI product creation flow
  • Type features in the "Starting Information" screen.
  • Alternatively, you can select a package image to auto detect and fill features.
  • Tap on "Generate Product Details" button
  • From Xcode logs validate that the following event is tracked.
🔵 Tracked product_creation_ai_generate_details_tapped, properties: [was_ecommerce_trial: false, is_wpcom_store: false, blog_id: 123, feature_word_count: 12, site_url: https://test.com, store_id: 1230, is_first_attempt: true, plan: jetpack_free]
  • The feature_word_count should reflect the number of words entered in the text field.
  • Once the generation is completed, you should see the product preview screen with generated details.
  • Tap on the "Generate Again" button at the bottom of the screen.
  • From Xcode logs, validate that the product_creation_ai_generate_details_tapped event is tracked again with the feature_word_count property.

Screenshots

Starting information Preview screen
Simulator Screenshot - iPhone 15 Pro Max - 2024-07-24 at 17 15 14 Simulator Screenshot - iPhone 15 Pro Max - 2024-07-24 at 17 19 59

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@selanthiraiyan selanthiraiyan added the feature: add/edit products Related to adding or editing products. label Jul 24, 2024
@selanthiraiyan selanthiraiyan added this to the 19.7 milestone Jul 24, 2024
@dangermattic
Copy link
Collaborator

dangermattic commented Jul 24, 2024

1 Warning
⚠️ This PR is assigned to the milestone 19.7. This milestone is due in less than 2 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@selanthiraiyan selanthiraiyan marked this pull request as ready for review July 24, 2024 11:54
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jul 24, 2024

WooCommerce iOS📲 You can test the changes from this Pull Request in WooCommerce iOS by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS WooCommerce iOS
Build Numberpr13411-c5aacd4
Version19.6
Bundle IDcom.automattic.alpha.woocommerce
Commitc5aacd4
App Center BuildWooCommerce - Prototype Builds #10129
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@itsmeichigo itsmeichigo self-assigned this Jul 25, 2024
Copy link
Contributor

@itsmeichigo itsmeichigo left a 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
Copy link
Contributor

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:):

Suggested change
let wordCount = features.split { $0 == " " || $0.isNewline }.count
let wordCount = features.components(separatedBy: .whitespacesAndNewlines).count

Copy link
Contributor Author

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

Comment on lines 40 to 43
let properties: [String: WooAnalyticsEventPropertyType?] = [Key.isFirstAttempt.rawValue: isFirstAttempt,
Key.featureWordCount.rawValue: wordCount]
return WooAnalyticsEvent(statName: .productCreationAIGenerateDetailsTapped,
properties: properties.compactMapValues { $0 })
Copy link
Contributor

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?

Copy link
Contributor Author

@selanthiraiyan selanthiraiyan Jul 25, 2024

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

@selanthiraiyan selanthiraiyan enabled auto-merge July 25, 2024 04:23
@selanthiraiyan selanthiraiyan merged commit 6b9d5a9 into trunk Jul 25, 2024
22 checks passed
@selanthiraiyan selanthiraiyan deleted the feat/13118-tracking branch July 25, 2024 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: add/edit products Related to adding or editing products.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants