diff --git a/plugins/woocommerce/changelog/add-appearance-theme-tracks b/plugins/woocommerce/changelog/add-appearance-theme-tracks new file mode 100644 index 00000000000..4ddce766a9f --- /dev/null +++ b/plugins/woocommerce/changelog/add-appearance-theme-tracks @@ -0,0 +1,4 @@ +Significance: minor +Type: add + +Add Tracks events to Appearance > Themes screen diff --git a/plugins/woocommerce/src/Internal/Admin/Loader.php b/plugins/woocommerce/src/Internal/Admin/Loader.php index 8a307e55433..c56932d36bd 100644 --- a/plugins/woocommerce/src/Internal/Admin/Loader.php +++ b/plugins/woocommerce/src/Internal/Admin/Loader.php @@ -93,6 +93,8 @@ class Loader { remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); add_action( 'admin_init', array( __CLASS__, 'deactivate_wc_admin_plugin' ) ); + + add_action( 'load-themes.php', array( __CLASS__, 'add_appearance_theme_view_tracks_event' ) ); } /** @@ -571,4 +573,11 @@ class Loader { delete_option( 'woocommerce_onboarding_homepage_post_id' ); } } + + /** + * Adds the appearance_theme_view Tracks event. + */ + public static function add_appearance_theme_view_tracks_event() { + wc_admin_record_tracks_event( 'appearance_theme_view', array() ); + } }