From 3300aef6c70d819151baa7589b6d34a940944b9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cem=20=C3=9Cnalan?= Date: Fri, 13 Sep 2024 00:13:13 +0300 Subject: [PATCH] In-App Marketplace: Record the legacy Tracks event for Discover page (#51163) * In-App Marketplace: Record the legacy Tracks event for Discover page Fixes #21486 * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: github-actions --- .../client/marketplace/components/discover/discover.tsx | 8 ++++++++ .../changelog/51163-fix-21486-iam-discover-tracks | 4 ++++ 2 files changed, 12 insertions(+) create mode 100644 plugins/woocommerce/changelog/51163-fix-21486-iam-discover-tracks diff --git a/plugins/woocommerce-admin/client/marketplace/components/discover/discover.tsx b/plugins/woocommerce-admin/client/marketplace/components/discover/discover.tsx index 06862502169..29af7037332 100644 --- a/plugins/woocommerce-admin/client/marketplace/components/discover/discover.tsx +++ b/plugins/woocommerce-admin/client/marketplace/components/discover/discover.tsx @@ -13,6 +13,7 @@ import ProductLoader from '../product-loader/product-loader'; import { MarketplaceContext } from '../../contexts/marketplace-context'; import { ProductType } from '../product-list/types'; import './discover.scss'; +import { recordMarketplaceView } from '~/marketplace/utils/tracking'; export default function Discover(): JSX.Element | null { const [ productGroups, setProductGroups ] = useState< @@ -28,10 +29,17 @@ export default function Discover(): JSX.Element | null { return product.id; } ); + // This is a new event specific to the Discover tab, added with Woo 8.4. recordEvent( 'marketplace_discover_viewed', { view: 'discover', product_ids, } ); + + // This is the new page view event added with Woo 8.3. It's improved with the marketplace_discover_viewed event + // but we'll keep it for a while to keep it compatible. + recordMarketplaceView( { + view: 'discover', + } ); } // Get the content for this screen diff --git a/plugins/woocommerce/changelog/51163-fix-21486-iam-discover-tracks b/plugins/woocommerce/changelog/51163-fix-21486-iam-discover-tracks new file mode 100644 index 00000000000..f2459934217 --- /dev/null +++ b/plugins/woocommerce/changelog/51163-fix-21486-iam-discover-tracks @@ -0,0 +1,4 @@ +Significance: patch +Type: tweak +Comment: Fix missing Tracks event from the Extensions > Discover page +