From af7cbb20a9fd085de72408e79f7e6941895af69e Mon Sep 17 00:00:00 2001 From: Christos Date: Mon, 30 Sep 2024 17:11:21 +0300 Subject: [PATCH] Stepper: Ensure calypso_signup_start doesn't get recorded over and over / 50 times --- .../hooks/use-sign-up-start-tracking/index.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/client/landing/stepper/declarative-flow/internals/hooks/use-sign-up-start-tracking/index.tsx b/client/landing/stepper/declarative-flow/internals/hooks/use-sign-up-start-tracking/index.tsx index 1a7c7a3411167e..ade3eb09ec5e8f 100644 --- a/client/landing/stepper/declarative-flow/internals/hooks/use-sign-up-start-tracking/index.tsx +++ b/client/landing/stepper/declarative-flow/internals/hooks/use-sign-up-start-tracking/index.tsx @@ -46,9 +46,11 @@ export const useSignUpStartTracking = ( { flow }: Props ) => { adTrackSignupStart( flowName ); }, [ isSignupFlow, flowName ] ); - if ( ! isSignupFlow ) { - return; - } + useEffect( () => { + if ( ! isSignupFlow ) { + return; + } - recordSignupStart( { flow: flowName, ref, optionalProps: extraProps || {} } ); + recordSignupStart( { flow: flowName, ref, optionalProps: extraProps || {} } ); + }, [ isSignupFlow, flowName, ref, extraProps ] ); };