Skip to content

Commit

Permalink
Tweak "Proceed to checkout" event tracking (#8635)
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarcosta99 authored Apr 12, 2024
1 parent f554ee5 commit daf84cd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions changelog/update-proceed-to-checkout-tracking
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: dev
Comment: Update "Proceed to checkout" tracking to take the skip_woopay cookie into account.


7 changes: 4 additions & 3 deletions client/cart/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
import { recordUserEvent } from 'tracks';
import { getConfig } from 'wcpay/utils/checkout';
import WooPayDirectCheckout from 'wcpay/checkout/woopay/direct-checkout/woopay-direct-checkout';
import { shouldSkipWooPay } from 'wcpay/checkout/woopay/utils';

const recordProceedToCheckoutButtonClick = () => {
recordUserEvent( 'wcpay_proceed_to_checkout_button_click', {
woopay_direct_checkout: Boolean(
getConfig( 'isWooPayDirectCheckoutEnabled' )
),
woopay_direct_checkout:
Boolean( getConfig( 'isWooPayDirectCheckoutEnabled' ) ) &&
! shouldSkipWooPay(),
} );
};

Expand Down

0 comments on commit daf84cd

Please sign in to comment.