diff --git a/changelog/fix-9651-record-tracks-event-capital-view-offer-redirect b/changelog/fix-9651-record-tracks-event-capital-view-offer-redirect new file mode 100644 index 00000000000..57b1e4a1a7d --- /dev/null +++ b/changelog/fix-9651-record-tracks-event-capital-view-offer-redirect @@ -0,0 +1,5 @@ +Significance: patch +Type: update + +When tracking is enabled, send a tracks event when the merchant is redirected to a Stripe Capital offer. + diff --git a/includes/class-wc-payments-redirect-service.php b/includes/class-wc-payments-redirect-service.php index bc4c3c77a54..7863cf0aa6d 100644 --- a/includes/class-wc-payments-redirect-service.php +++ b/includes/class-wc-payments-redirect-service.php @@ -8,6 +8,7 @@ use WCPay\Core\Server\Request\Get_Account_Capital_Link; use WCPay\Core\Server\Request\Get_Account_Login_Data; use WCPay\Exceptions\API_Exception; +use WCPay\Tracker; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. @@ -92,6 +93,7 @@ public function redirect_to_capital_view_offer_page(): void { $request->set_refresh_url( $refresh_url ); $capital_link = $request->send(); + Tracker::track_admin( 'wcpay_capital_view_offer_redirect' ); $this->redirect_to( $capital_link['url'] ); } catch ( Exception $e ) {