diff --git a/projects/plugins/boost/app/assets/src/js/features/ui/back-button/back-button.tsx b/projects/plugins/boost/app/assets/src/js/features/ui/back-button/back-button.tsx index 83cb3472a619c..0ddc28ac2057c 100644 --- a/projects/plugins/boost/app/assets/src/js/features/ui/back-button/back-button.tsx +++ b/projects/plugins/boost/app/assets/src/js/features/ui/back-button/back-button.tsx @@ -1,6 +1,7 @@ import { __ } from '@wordpress/i18n'; import LeftArrow from '$svg/left-arrow'; import { useNavigate } from 'react-router-dom'; +import { recordBoostEvent } from '$lib/utils/analytics'; type BackButtonProps = { route?: string; @@ -9,6 +10,10 @@ type BackButtonProps = { const BackButton: React.FC< BackButtonProps > = ( { route = '/' } ) => { const navigate = useNavigate(); const handleBack = () => { + recordBoostEvent( 'back_button_clicked', { + current_page: window.location.pathname + window.location.search + window.location.hash, + destination: route, + } ); navigate( route ); };