Skip to content

Commit

Permalink
Moved the pre checked checkout_save_my_info_click event
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardola committed Apr 15, 2024
1 parent b398ecf commit 3a38086
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
6 changes: 6 additions & 0 deletions client/checkout/woopay/email-input-iframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,12 @@ export const handleWooPayEmailInput = async (
openIframe( email );
} else if ( data.code !== 'rest_invalid_param' ) {
recordUserEvent( 'checkout_woopay_save_my_info_offered' );

if ( window.woopayCheckout?.PRE_CHECK_SAVE_MY_INFO ) {
recordUserEvent( 'checkout_save_my_info_click', {
status: 'checked',
} );
}
}
} )
.catch( ( err ) => {
Expand Down
10 changes: 0 additions & 10 deletions client/components/woopay/save-user/checkout-page-save-user.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,6 @@ const CheckoutPageSaveUser = ( { isBlocksCheckout } ) => {
const viewportWidth = window.document.documentElement.clientWidth;
const viewportHeight = window.document.documentElement.clientHeight;

useEffect( () => {
if ( window.woopayCheckout?.PRE_CHECK_SAVE_MY_INFO ) {
recordUserEvent( 'checkout_save_my_info_click', {
status: 'checked',
} );
}
// We only want to run this once.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [] );

const getPhoneFieldValue = () => {
let phoneFieldValue = '';
if ( isBlocksCheckout ) {
Expand Down

0 comments on commit 3a38086

Please sign in to comment.