Add the wccore_subscriptions_empty_state_view tracking event.

This commit is contained in:
Chris Aprea 2022-05-10 15:43:47 +10:00
parent c421733dec
commit fc55f14fdd
1 changed files with 9 additions and 1 deletions

View File

@ -2,7 +2,11 @@
* External dependencies * External dependencies
*/ */
import { __ } from '@wordpress/i18n'; import { __ } from '@wordpress/i18n';
import { createInterpolateElement, useState } from '@wordpress/element'; import {
createInterpolateElement,
useEffect,
useState,
} from '@wordpress/element';
import { Button, Card, CardBody, Notice } from '@wordpress/components'; import { Button, Card, CardBody, Notice } from '@wordpress/components';
import { PLUGINS_STORE_NAME, OPTIONS_STORE_NAME } from '@woocommerce/data'; import { PLUGINS_STORE_NAME, OPTIONS_STORE_NAME } from '@woocommerce/data';
import { useDispatch } from '@wordpress/data'; import { useDispatch } from '@wordpress/data';
@ -263,6 +267,10 @@ const OnboardingSteps = () => (
const SubscriptionsPage = () => { const SubscriptionsPage = () => {
const [ hasError, setHasError ] = useState( false ); const [ hasError, setHasError ] = useState( false );
useEffect( () => {
recordEvent( 'wccore_subscriptions_empty_state_view' );
}, [] );
return ( return (
<> <>
{ hasError && <ErrorNotice /> } { hasError && <ErrorNotice /> }