From 2520781c7e47b4689d5264f77f9ca93d69f1aa5a Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Mon, 16 May 2022 17:28:30 +0800 Subject: [PATCH] Add tasklist_view_more_product_types_click track event for add product task --- .../client/tasks/fills/experimental-products/index.tsx | 10 +++++++++- .../tasks/fills/experimental-products/test/index.tsx | 6 +++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/plugins/woocommerce-admin/client/tasks/fills/experimental-products/index.tsx b/plugins/woocommerce-admin/client/tasks/fills/experimental-products/index.tsx index 071395ad691..6a82283d802 100644 --- a/plugins/woocommerce-admin/client/tasks/fills/experimental-products/index.tsx +++ b/plugins/woocommerce-admin/client/tasks/fills/experimental-products/index.tsx @@ -12,6 +12,7 @@ import { useMemo, useState } from '@wordpress/element'; import { Button, Spinner } from '@wordpress/components'; import { getAdminLink } from '@woocommerce/settings'; import { Icon, chevronDown, chevronUp } from '@wordpress/icons'; +import { recordEvent } from '@woocommerce/tracks'; /** * Internal dependencies @@ -147,7 +148,14 @@ export const Products = () => { ) } setIsExpanded( ! isExpanded ) } + onClick={ () => { + if ( ! isExpanded ) { + recordEvent( + 'tasklist_view_more_product_types_click' + ); + } + setIsExpanded( ! isExpanded ); + } } />