Add Tracks event (https://github.com/woocommerce/woocommerce-admin/pull/7960)
Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
This commit is contained in:
parent
d64a276032
commit
c634ed5eb7
|
@ -101,9 +101,10 @@ export class ProductTypes extends Component {
|
|||
updateProfileItems,
|
||||
} = this.props;
|
||||
|
||||
recordEvent( 'storeprofiler_store_product_type_continue', {
|
||||
const eventProps = {
|
||||
product_type: selected,
|
||||
} );
|
||||
wcpay_installed: false,
|
||||
};
|
||||
|
||||
const promises = [ updateProfileItems( { product_types: selected } ) ];
|
||||
|
||||
|
@ -117,6 +118,7 @@ export class ProductTypes extends Component {
|
|||
promises.push(
|
||||
installAndActivatePlugins( [ 'woocommerce-payments' ] )
|
||||
.then( ( response ) => {
|
||||
eventProps.wcpay_installed = true;
|
||||
createNoticesFromResponse( response );
|
||||
} )
|
||||
.catch( ( error ) => {
|
||||
|
@ -127,7 +129,13 @@ export class ProductTypes extends Component {
|
|||
}
|
||||
|
||||
Promise.all( promises )
|
||||
.then( () => goToNextStep() )
|
||||
.then( () => {
|
||||
recordEvent(
|
||||
'storeprofiler_store_product_type_continue',
|
||||
eventProps
|
||||
);
|
||||
goToNextStep();
|
||||
} )
|
||||
.catch( () =>
|
||||
createNotice(
|
||||
'error',
|
||||
|
|
Loading…
Reference in New Issue