woocommerce/plugins/woocommerce-admin/client/wp-admin-scripts/product-tracking/product-new.ts

19 lines
338 B
TypeScript

/**
* External dependencies
*/
import { recordEvent } from '@woocommerce/tracks';
/**
* Internal dependencies
*/
import { initProductScreenTracks } from './shared';
const initTracks = () => {
recordEvent( 'product_add_view' );
};
if ( productScreen && productScreen.name === 'new' ) {
initTracks();
initProductScreenTracks();
}