From daf84cd20041bb4c67462455c49ab230cca87f1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9sar=20Costa?= <10233985+cesarcosta99@users.noreply.github.com> Date: Fri, 12 Apr 2024 17:11:49 -0300 Subject: [PATCH] Tweak "Proceed to checkout" event tracking (#8635) --- changelog/update-proceed-to-checkout-tracking | 5 +++++ client/cart/index.js | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 changelog/update-proceed-to-checkout-tracking diff --git a/changelog/update-proceed-to-checkout-tracking b/changelog/update-proceed-to-checkout-tracking new file mode 100644 index 00000000000..585b2dbb184 --- /dev/null +++ b/changelog/update-proceed-to-checkout-tracking @@ -0,0 +1,5 @@ +Significance: patch +Type: dev +Comment: Update "Proceed to checkout" tracking to take the skip_woopay cookie into account. + + diff --git a/client/cart/index.js b/client/cart/index.js index 7125abc99d8..3f995435df6 100644 --- a/client/cart/index.js +++ b/client/cart/index.js @@ -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(), } ); };