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

[Live Preview in Premium/Woo themes] Add tracking events #85526

Merged
merged 5 commits into from
Dec 22, 2023

Conversation

okmttdhr
Copy link
Member

@okmttdhr okmttdhr commented Dec 20, 2023

Related to #79223

Proposed Changes

This PR adds tracking events for "Live Preview in Premium/Woo themes". I added the following events;

  • calypso_block_theme_live_preview_upgrade_modal_open
    • This event is fired when users open the upgrade modal either by clicking the button or using the shortcut (cmd+S).
      Screenshot 2023-12-21 at 11 28 53
      Screenshot 2023-12-21 at 11 29 08
  • calypso_block_theme_live_preview_click_upgrade -> calypso_block_theme_live_preview_upgrade_modal_upgrade
    • This event is fired when users click the upgrade button on the modal.
      Screenshot 2023-12-21 at 11 27 31
  • calypso_block_theme_live_preview_upgrade_modal_close
    • This event is fired when the modal is closed for any reason.

We can include the wpcom_product_purchase event (for checkout completion) and the wpcom_block_editor_save_click event (for theme activation) in funnels.

Testing Instructions

Please Test it on https://horizon.wordpress.com/.

  • Sandbox your site and widgets.wp.com.
  • Run install-plugin.sh wpcom-block-editor add/live-preview-track-event on your sandbox.
  • Go to the Theme Showcase page and pick a Premium or Woo theme.
  • Click the Upgrade now button.
  • Verify the event is fired.
    • When you click the button on the header in the edit mode.
      Screenshot 2023-12-21 at 11 19 50
    • When you click the button on the sidebar.
      Screenshot 2023-12-21 at 11 19 34
    • When you use the shortcut.
      Screenshot 2023-12-21 at 11 32 13
  • Verify the event is fired when you close the modal by
    • Clicking the close icon
      Screenshot 2023-12-22 at 11 13 56
    • Clicking the Cancel button
      Screenshot 2023-12-22 at 11 14 06
    • Clicking the overlay or typing the escape key
      Screenshot 2023-12-22 at 11 14 15
  • Click the Upgrade plan button on the modal.
  • Verify the event is fired.
    Screenshot 2023-12-22 at 11 15 11

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • https://wpcalypso.wordpress.com/devdocs/docs/testing/index.md for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-ajp-p2)?

Copy link

github-actions bot commented Dec 20, 2023

@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug add/live-preview-track-event on your sandbox.

@matticbot
Copy link
Contributor

matticbot commented Dec 20, 2023

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~20 bytes added 📈 [gzipped])

name         parsed_size           gzip_size
import-flow        +72 B  (+0.0%)      +20 B  (+0.0%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@okmttdhr okmttdhr force-pushed the add/live-preview-track-event branch from d4f16b6 to 9d2fe14 Compare December 21, 2023 02:01
@okmttdhr okmttdhr marked this pull request as ready for review December 21, 2023 02:33
@okmttdhr okmttdhr requested a review from a team December 21, 2023 02:38
@okmttdhr okmttdhr self-assigned this Dec 21, 2023
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 21, 2023
@taipeicoder
Copy link
Contributor

Using the shortcut returns canvas_mode: view while in edit mode:
Screenshot 2023-12-21 at 11 17 34 AM

@taipeicoder
Copy link
Contributor

We could also track when upgrade modal is closed via user-interaction:

  • Clicking the Cancel button.
  • Clicking the Close button.
  • Clicking the backdrop or pressing the Esc button.

WDYT? @okmttdhr @autumnfjeld

@autumnfjeld
Copy link
Contributor

autumnfjeld commented Dec 21, 2023

calypso_block_theme_live_preview_click_upgrade
This event is fired when users click the upgrade button on the modal.

This event should include the word modal, maybe: calypso_block_theme_live_preview_upgrade_modal_upgradeclick
or
calypso_block_theme_live_preview_upgrade_modal_upgrade_click

or
calypso_block_theme_live_preview_upgrade_modal_button_click)
with prop action=upgrade

You can see other modal events by searching for "modal" in tracks events.

@autumnfjeld
Copy link
Contributor

autumnfjeld commented Dec 21, 2023

We could also track when upgrade modal is closed via user-interaction:

  • Clicking the Cancel button.
  • Clicking the Close button.
  • Clicking the backdrop or pressing the Esc button.

WDYT? @okmttdhr @autumnfjeld

That could be interesting, like a measure of curiosity about upgrading.

calypso_block_theme_live_preview_upgrade_modal_closeclick , should be consistent naming as with my comment above. :)

Copy link
Contributor

@arthur791004 arthur791004 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good 👍

@okmttdhr okmttdhr force-pushed the add/live-preview-track-event branch from f636b91 to 48faaa1 Compare December 22, 2023 02:20
@okmttdhr
Copy link
Member Author

@taipeicoder @autumnfjeld

Using the shortcut returns canvas_mode: view while in edit mode: Screenshot 2023-12-21 at 11 17 34 AM

I addressed this. Thank you for pointing this out!

We could also track when upgrade modal is closed via user-interaction:
This event should include the word modal, maybe: calypso_block_theme_live_preview_upgrade_modal_upgradeclick

I added calypso_block_theme_live_preview_upgrade_modal_close with closed_by='close_icon' | 'cancel_button' | 'dialog_action', and renamed calypso_block_theme_live_preview_click_upgrade to calypso_block_theme_live_preview_upgrade_modal_upgrade, aligning with calypso_block_theme_live_preview_upgrade_modal_close. 🙂

Copy link
Contributor

@taipeicoder taipeicoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🙂

@okmttdhr okmttdhr merged commit 3c1d3ae into trunk Dec 22, 2023
11 checks passed
@okmttdhr okmttdhr deleted the add/live-preview-track-event branch December 22, 2023 04:10
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants