diff --git a/client/landing/stepper/declarative-flow/ai-assembler.ts b/client/landing/stepper/declarative-flow/ai-assembler.ts index 32dacf1a3e3de..b60c10faccc67 100644 --- a/client/landing/stepper/declarative-flow/ai-assembler.ts +++ b/client/landing/stepper/declarative-flow/ai-assembler.ts @@ -12,7 +12,6 @@ import { getCurrentUserSiteCount, isUserLoggedIn } from 'calypso/state/current-u import { getTheme } from 'calypso/state/themes/selectors'; import { ONBOARD_STORE, SITE_STORE } from '../stores'; import { stepsWithRequiredLogin } from '../utils/steps-with-required-login'; -import { recordSubmitStep } from './internals/analytics/record-submit-step'; import { STEPS } from './internals/steps'; import { ProcessingResult } from './internals/steps-repository/processing-step/constants'; import { @@ -80,11 +79,6 @@ const withAIAssemblerFlow: Flow = { }, useStepNavigation( _currentStep, navigate ) { - const flowName = this.name; - const intent = useSelect( - ( select ) => ( select( ONBOARD_STORE ) as OnboardSelect ).getIntent(), - [] - ); const siteId = useSelect( ( select ) => ( select( ONBOARD_STORE ) as OnboardSelect ).getSelectedSite(), [] @@ -169,7 +163,6 @@ const withAIAssemblerFlow: Flow = { providedDependencies: ProvidedDependencies = {}, ...results: string[] ) => { - recordSubmitStep( providedDependencies, intent, flowName, _currentStep ); const selectedSiteSlug = providedDependencies?.siteSlug as string; const selectedSiteId = providedDependencies?.siteId as string; diff --git a/client/landing/stepper/declarative-flow/assembler-first-flow.ts b/client/landing/stepper/declarative-flow/assembler-first-flow.ts index 4f41838f1d799..a98122cf5deef 100644 --- a/client/landing/stepper/declarative-flow/assembler-first-flow.ts +++ b/client/landing/stepper/declarative-flow/assembler-first-flow.ts @@ -11,7 +11,6 @@ import { getTheme } from 'calypso/state/themes/selectors'; import { useSiteData } from '../hooks/use-site-data'; import { ONBOARD_STORE, SITE_STORE } from '../stores'; import { stepsWithRequiredLogin } from '../utils/steps-with-required-login'; -import { recordSubmitStep } from './internals/analytics/record-submit-step'; import { STEPS } from './internals/steps'; import { ProcessingResult } from './internals/steps-repository/processing-step/constants'; import { @@ -80,11 +79,6 @@ const assemblerFirstFlow: Flow = { }, useStepNavigation( _currentStep, navigate ) { - const flowName = this.name; - const intent = useSelect( - ( select ) => ( select( ONBOARD_STORE ) as OnboardSelect ).getIntent(), - [] - ); const { setPendingAction, setSelectedSite } = useDispatch( ONBOARD_STORE ); const { saveSiteSettings, setIntentOnSite } = useDispatch( SITE_STORE ); const { site, siteSlug, siteId } = useSiteData(); @@ -133,8 +127,6 @@ const assemblerFirstFlow: Flow = { providedDependencies: ProvidedDependencies = {}, ...results: string[] ) => { - recordSubmitStep( providedDependencies, intent, flowName, _currentStep ); - switch ( _currentStep ) { case 'check-sites': { // Check for unlaunched sites diff --git a/client/landing/stepper/declarative-flow/build.ts b/client/landing/stepper/declarative-flow/build.ts index a717461c880c6..d9ff37f431c03 100644 --- a/client/landing/stepper/declarative-flow/build.ts +++ b/client/landing/stepper/declarative-flow/build.ts @@ -4,7 +4,6 @@ import { skipLaunchpad } from 'calypso/landing/stepper/utils/skip-launchpad'; import { triggerGuidesForStep } from 'calypso/lib/guides/trigger-guides-for-step'; import { useSiteIdParam } from '../hooks/use-site-id-param'; import { useSiteSlug } from '../hooks/use-site-slug'; -import { recordSubmitStep } from './internals/analytics/record-submit-step'; import LaunchPad from './internals/steps-repository/launchpad'; import Processing from './internals/steps-repository/processing-step'; import { Flow, ProvidedDependencies } from './internals/types'; @@ -30,8 +29,6 @@ const build: Flow = { triggerGuidesForStep( flowName, _currentStep ); const submit = ( providedDependencies: ProvidedDependencies = {} ) => { - recordSubmitStep( providedDependencies, '', flowName, _currentStep ); - switch ( _currentStep ) { case 'processing': if ( providedDependencies?.goToHome && providedDependencies?.siteSlug ) { diff --git a/client/landing/stepper/declarative-flow/connect-domain.ts b/client/landing/stepper/declarative-flow/connect-domain.ts index d707ba9521276..c609b4babf70a 100644 --- a/client/landing/stepper/declarative-flow/connect-domain.ts +++ b/client/landing/stepper/declarative-flow/connect-domain.ts @@ -152,7 +152,6 @@ const connectDomain: Flow = { submit, }; }, - use__Temporary__ShouldTrackEvent: ( event ) => 'submit' === event, }; export default connectDomain; diff --git a/client/landing/stepper/declarative-flow/copy-site.tsx b/client/landing/stepper/declarative-flow/copy-site.tsx index 642402db7d75f..fdc6bd8be1876 100644 --- a/client/landing/stepper/declarative-flow/copy-site.tsx +++ b/client/landing/stepper/declarative-flow/copy-site.tsx @@ -12,7 +12,6 @@ import { setSignupCompleteFlowName, } from 'calypso/signup/storageUtils'; import { useSiteCopy } from '../hooks/use-site-copy'; -import { recordSubmitStep } from './internals/analytics/record-submit-step'; import AutomatedCopySite from './internals/steps-repository/automated-copy-site'; import CreateSite from './internals/steps-repository/create-site'; import DomainsStep from './internals/steps-repository/domains'; @@ -108,8 +107,6 @@ const copySite: Flow = { const urlQueryParams = useQuery(); const submit = async ( providedDependencies: ProvidedDependencies = {} ) => { - recordSubmitStep( providedDependencies, '', flowName, _currentStepSlug ); - switch ( _currentStepSlug ) { case 'domains': { return navigate( 'create-site', { diff --git a/client/landing/stepper/declarative-flow/design-first.ts b/client/landing/stepper/declarative-flow/design-first.ts index 08474f854490a..ffcd6039ff435 100644 --- a/client/landing/stepper/declarative-flow/design-first.ts +++ b/client/landing/stepper/declarative-flow/design-first.ts @@ -5,7 +5,6 @@ import { useEffect } from '@wordpress/element'; import { addQueryArgs, getQueryArg } from '@wordpress/url'; import { translate } from 'i18n-calypso'; import { useSelector } from 'react-redux'; -import { recordSubmitStep } from 'calypso/landing/stepper/declarative-flow/internals/analytics/record-submit-step'; import { redirect } from 'calypso/landing/stepper/declarative-flow/internals/steps-repository/import/util'; import { type AssertConditionResult, @@ -92,8 +91,6 @@ const designFirst: Flow = { }, [ siteSlug, setIntentOnSite, isSiteLaunched ] ); async function submit( providedDependencies: ProvidedDependencies = {} ) { - recordSubmitStep( providedDependencies, '', flowName, currentStep ); - switch ( currentStep ) { case 'check-sites': // Check for unlaunched sites diff --git a/client/landing/stepper/declarative-flow/domain-transfer.ts b/client/landing/stepper/declarative-flow/domain-transfer.ts index 2ad9da64c01cc..01880d8f58ddc 100644 --- a/client/landing/stepper/declarative-flow/domain-transfer.ts +++ b/client/landing/stepper/declarative-flow/domain-transfer.ts @@ -11,7 +11,6 @@ import { import { isUserLoggedIn } from 'calypso/state/current-user/selectors'; import { USER_STORE } from '../stores'; import { useLoginUrl } from '../utils/path'; -import { recordSubmitStep } from './internals/analytics/record-submit-step'; import { Flow, ProvidedDependencies, @@ -70,8 +69,6 @@ const domainTransfer: Flow = { } ); const submit = ( providedDependencies: ProvidedDependencies = {} ) => { - recordSubmitStep( providedDependencies, '', flowName, _currentStepSlug ); - switch ( _currentStepSlug ) { case 'intro': clearSignupDestinationCookie(); diff --git a/client/landing/stepper/declarative-flow/domain-user-transfer.ts b/client/landing/stepper/declarative-flow/domain-user-transfer.ts index 878879e2b2a14..f3315916827f7 100644 --- a/client/landing/stepper/declarative-flow/domain-user-transfer.ts +++ b/client/landing/stepper/declarative-flow/domain-user-transfer.ts @@ -1,6 +1,5 @@ import { useEffect } from '@wordpress/element'; import { translate } from 'i18n-calypso'; -import { recordSubmitStep } from 'calypso/landing/stepper/declarative-flow/internals/analytics/record-submit-step'; import { redirect } from 'calypso/landing/stepper/declarative-flow/internals/steps-repository/import/util'; import { AssertConditionResult, @@ -23,10 +22,7 @@ const domainUserTransfer: Flow = { }, useStepNavigation( currentStep, navigate ) { - const flowName = this.name; - function submit( providedDependencies: ProvidedDependencies = {} ) { - recordSubmitStep( providedDependencies, '', flowName, currentStep ); switch ( currentStep ) { case 'domain-contact-info': return window.location.assign( diff --git a/client/landing/stepper/declarative-flow/entrepreneur-flow.ts b/client/landing/stepper/declarative-flow/entrepreneur-flow.ts index 38ebb818d496a..9cb5b2d9be0b7 100644 --- a/client/landing/stepper/declarative-flow/entrepreneur-flow.ts +++ b/client/landing/stepper/declarative-flow/entrepreneur-flow.ts @@ -8,7 +8,6 @@ import { isUserLoggedIn } from 'calypso/state/current-user/selectors'; import { useFlowLocale } from '../hooks/use-flow-locale'; import { USER_STORE, ONBOARD_STORE } from '../stores'; import { getLoginUrl } from '../utils/path'; -import { recordSubmitStep } from './internals/analytics/record-submit-step'; import { STEPS } from './internals/steps'; import { ProcessingResult } from './internals/steps-repository/processing-step/constants'; import { ENTREPRENEUR_TRIAL_SURVEY_KEY } from './internals/steps-repository/segmentation-survey'; @@ -78,8 +77,6 @@ const entrepreneurFlow: Flow = { }; function submit( providedDependencies: ProvidedDependencies = {}, ...params: string[] ) { - recordSubmitStep( providedDependencies, '' /* intent */, flowName, currentStep ); - switch ( currentStep ) { case SEGMENTATION_SURVEY_SLUG: { setIsMigrationFlow( !! providedDependencies.isMigrationFlow ); diff --git a/client/landing/stepper/declarative-flow/free-post-setup.ts b/client/landing/stepper/declarative-flow/free-post-setup.ts index 1db8798c77aaf..259b888c45c94 100644 --- a/client/landing/stepper/declarative-flow/free-post-setup.ts +++ b/client/landing/stepper/declarative-flow/free-post-setup.ts @@ -50,7 +50,6 @@ const freePostSetup: Flow = { return { goNext, goBack, goToStep, submit }; }, - use__Temporary__ShouldTrackEvent: ( event ) => 'submit' === event, }; export default freePostSetup; diff --git a/client/landing/stepper/declarative-flow/free.ts b/client/landing/stepper/declarative-flow/free.ts index 26dd6b01b264f..4047eec24a41f 100644 --- a/client/landing/stepper/declarative-flow/free.ts +++ b/client/landing/stepper/declarative-flow/free.ts @@ -16,7 +16,6 @@ import { useSiteIdParam } from '../hooks/use-site-id-param'; import { useSiteSlug } from '../hooks/use-site-slug'; import { ONBOARD_STORE } from '../stores'; import { stepsWithRequiredLogin } from '../utils/steps-with-required-login'; -import { recordSubmitStep } from './internals/analytics/record-submit-step'; import { STEPS } from './internals/steps'; import { ProcessingResult } from './internals/steps-repository/processing-step/constants'; import { Flow, ProvidedDependencies } from './internals/types'; @@ -68,8 +67,6 @@ const free: Flow = { }; const submit = ( providedDependencies: ProvidedDependencies = {}, ...results: string[] ) => { - recordSubmitStep( providedDependencies, '', flowName, _currentStep ); - switch ( _currentStep ) { case 'freeSetup': return navigate( 'create-site' ); diff --git a/client/landing/stepper/declarative-flow/hundred-year-plan.ts b/client/landing/stepper/declarative-flow/hundred-year-plan.ts index 86173727f44a4..9581237815eaf 100644 --- a/client/landing/stepper/declarative-flow/hundred-year-plan.ts +++ b/client/landing/stepper/declarative-flow/hundred-year-plan.ts @@ -11,7 +11,6 @@ import { import { SiteId, SiteSlug } from 'calypso/types'; import { ONBOARD_STORE, USER_STORE } from '../stores'; import { stepsWithRequiredLogin } from '../utils/steps-with-required-login'; -import { recordSubmitStep } from './internals/analytics/record-submit-step'; import type { ProvidedDependencies, Flow } from './internals/types'; const HundredYearPlanFlow: Flow = { @@ -88,8 +87,6 @@ const HundredYearPlanFlow: Flow = { const { setPlanCartItem, setPendingAction } = useDispatch( ONBOARD_STORE ); function submit( providedDependencies: ProvidedDependencies = {} ) { - recordSubmitStep( providedDependencies, '', flowName, _currentStep ); - const updateCartForExistingSite = async () => { if ( ! providedDependencies?.siteSlug || ! providedDependencies?.siteId ) { return; diff --git a/client/landing/stepper/declarative-flow/link-in-bio-post-setup.ts b/client/landing/stepper/declarative-flow/link-in-bio-post-setup.ts index 4d4a4348e55d6..9e535a8758b43 100644 --- a/client/landing/stepper/declarative-flow/link-in-bio-post-setup.ts +++ b/client/landing/stepper/declarative-flow/link-in-bio-post-setup.ts @@ -1,9 +1,11 @@ +import { Onboard } from '@automattic/data-stores'; import { LINK_IN_BIO_POST_SETUP_FLOW } from '@automattic/onboarding'; +import { useDispatch } from '@wordpress/data'; +import { useEffect } from '@wordpress/element'; import { translate } from 'i18n-calypso'; import { useSiteSlug } from '../hooks/use-site-slug'; -import { recordSubmitStep } from './internals/analytics/record-submit-step'; +import { ONBOARD_STORE } from '../stores'; import LinkInBioPostSetup from './internals/steps-repository/link-in-bio-post-setup'; -import { ProvidedDependencies } from './internals/types'; import type { Flow } from './internals/types'; const linkInBioPostSetup: Flow = { @@ -15,14 +17,18 @@ const linkInBioPostSetup: Flow = { useSteps() { return [ { slug: 'linkInBioPostSetup', component: LinkInBioPostSetup } ]; }, + useSideEffect() { + const { setIntent } = useDispatch( ONBOARD_STORE ); + + useEffect( () => { + setIntent( Onboard.SiteIntent.LinkInBioPostSetup ); + }, [] ); + }, useStepNavigation( currentStep ) { - const flowName = this.name; const siteSlug = useSiteSlug(); - function submit( providedDependencies: ProvidedDependencies = {} ) { - recordSubmitStep( providedDependencies, 'link-in-bio-post-setup', flowName, currentStep ); - + function submit() { switch ( currentStep ) { case 'linkInBioPostSetup': return window.location.assign( `/setup/link-in-bio/launchpad?siteSlug=${ siteSlug }` ); diff --git a/client/landing/stepper/declarative-flow/link-in-bio-tld.ts b/client/landing/stepper/declarative-flow/link-in-bio-tld.ts index dae54a00bd0bc..87e3794c176ba 100644 --- a/client/landing/stepper/declarative-flow/link-in-bio-tld.ts +++ b/client/landing/stepper/declarative-flow/link-in-bio-tld.ts @@ -12,7 +12,6 @@ import { import { useSiteIdParam } from '../hooks/use-site-id-param'; import { useSiteSlug } from '../hooks/use-site-slug'; import { stepsWithRequiredLogin } from '../utils/steps-with-required-login'; -import { recordSubmitStep } from './internals/analytics/record-submit-step'; import CreateSite from './internals/steps-repository/create-site'; import DesignCarousel from './internals/steps-repository/design-carousel'; import DomainsStep from './internals/steps-repository/domains'; @@ -48,8 +47,6 @@ const linkInBio: Flow = { triggerGuidesForStep( flowName, _currentStepSlug ); const submit = ( providedDependencies: ProvidedDependencies = {} ) => { - recordSubmitStep( providedDependencies, '', flowName, _currentStepSlug ); - switch ( _currentStepSlug ) { case 'domains': clearSignupDestinationCookie(); diff --git a/client/landing/stepper/declarative-flow/link-in-bio.ts b/client/landing/stepper/declarative-flow/link-in-bio.ts index 2bbb313ca556f..7af09c7479ab8 100644 --- a/client/landing/stepper/declarative-flow/link-in-bio.ts +++ b/client/landing/stepper/declarative-flow/link-in-bio.ts @@ -16,7 +16,6 @@ import { useSiteIdParam } from '../hooks/use-site-id-param'; import { useSiteSlug } from '../hooks/use-site-slug'; import { USER_STORE, ONBOARD_STORE } from '../stores'; import { stepsWithRequiredLogin } from '../utils/steps-with-required-login'; -import { recordSubmitStep } from './internals/analytics/record-submit-step'; import type { Flow, ProvidedDependencies } from './internals/types'; const linkInBio: Flow = { @@ -77,8 +76,6 @@ const linkInBio: Flow = { triggerGuidesForStep( flowName, _currentStepSlug ); const submit = ( providedDependencies: ProvidedDependencies = {} ) => { - recordSubmitStep( providedDependencies, '', flowName, _currentStepSlug ); - switch ( _currentStepSlug ) { case 'intro': clearSignupDestinationCookie(); diff --git a/client/landing/stepper/declarative-flow/migration-signup.ts b/client/landing/stepper/declarative-flow/migration-signup.ts index 1bb0e1c565e1a..018602e02ff54 100644 --- a/client/landing/stepper/declarative-flow/migration-signup.ts +++ b/client/landing/stepper/declarative-flow/migration-signup.ts @@ -10,11 +10,10 @@ import { useSiteSlugParam } from '../hooks/use-site-slug-param'; import { USER_STORE, ONBOARD_STORE, SITE_STORE } from '../stores'; import { goToCheckout } from '../utils/checkout'; import { stepsWithRequiredLogin } from '../utils/steps-with-required-login'; -import { recordSubmitStep } from './internals/analytics/record-submit-step'; import { STEPS } from './internals/steps'; import { type SiteMigrationIdentifyAction } from './internals/steps-repository/site-migration-identify'; import type { Flow, ProvidedDependencies } from './internals/types'; -import type { OnboardSelect, SiteSelect, UserSelect } from '@automattic/data-stores'; +import type { SiteSelect, UserSelect } from '@automattic/data-stores'; const FLOW_NAME = MIGRATION_SIGNUP_FLOW; @@ -71,11 +70,6 @@ const migrationSignup: Flow = { }, useStepNavigation( currentStep, navigate ) { - const flowName = this.name; - const intent = useSelect( - ( select ) => ( select( ONBOARD_STORE ) as OnboardSelect ).getIntent(), - [] - ); const siteSlugParam = useSiteSlugParam(); const urlQueryParams = useQuery(); const fromQueryParam = urlQueryParams.get( 'from' ); @@ -87,7 +81,6 @@ const migrationSignup: Flow = { // TODO - We may need to add `...params: string[]` back once we start adding more steps. function submit( providedDependencies: ProvidedDependencies = {} ) { - recordSubmitStep( providedDependencies, intent, flowName, currentStep ); const siteSlug = ( providedDependencies?.siteSlug as string ) || siteSlugParam || ''; const siteId = getSiteIdBySlug( siteSlug ) || urlQueryParams.get( 'siteId' ); diff --git a/client/landing/stepper/declarative-flow/migration/index.tsx b/client/landing/stepper/declarative-flow/migration/index.tsx index d64a5a43c57d8..22215d7ebdf1c 100644 --- a/client/landing/stepper/declarative-flow/migration/index.tsx +++ b/client/landing/stepper/declarative-flow/migration/index.tsx @@ -266,6 +266,4 @@ export default { return stepHandlers[ currentStep ]; }, - - use__Temporary__ShouldTrackEvent: ( event ) => 'submit' === event, } satisfies Flow; diff --git a/client/landing/stepper/declarative-flow/new-hosted-site-flow-user-included.ts b/client/landing/stepper/declarative-flow/new-hosted-site-flow-user-included.ts index 16122d074ae1c..d6cf792018de0 100644 --- a/client/landing/stepper/declarative-flow/new-hosted-site-flow-user-included.ts +++ b/client/landing/stepper/declarative-flow/new-hosted-site-flow-user-included.ts @@ -15,7 +15,6 @@ import { isUserEligibleForFreeHostingTrial } from 'calypso/state/selectors/is-us import { setSelectedSiteId } from 'calypso/state/ui/actions/index'; import { useQuery } from '../hooks/use-query'; import { ONBOARD_STORE, USER_STORE } from '../stores'; -import { recordSubmitStep } from './internals/analytics/record-submit-step'; import { Flow, ProvidedDependencies } from './internals/types'; import type { OnboardSelect, UserSelect } from '@automattic/data-stores'; import type { MinimalRequestCartProduct } from '@automattic/shopping-cart'; @@ -60,8 +59,6 @@ const hosting: Flow = { }; const submit = ( providedDependencies: ProvidedDependencies = {} ) => { - recordSubmitStep( providedDependencies, '', flowName, _currentStepSlug ); - switch ( _currentStepSlug ) { case 'user': { return navigate( 'plans' ); diff --git a/client/landing/stepper/declarative-flow/new-hosted-site-flow.ts b/client/landing/stepper/declarative-flow/new-hosted-site-flow.ts index 12e62e251b44f..8d6348d64e5dd 100644 --- a/client/landing/stepper/declarative-flow/new-hosted-site-flow.ts +++ b/client/landing/stepper/declarative-flow/new-hosted-site-flow.ts @@ -15,7 +15,6 @@ import { setSelectedSiteId } from 'calypso/state/ui/actions'; import { useQuery } from '../hooks/use-query'; import { ONBOARD_STORE, USER_STORE } from '../stores'; import { useLoginUrl } from '../utils/path'; -import { recordSubmitStep } from './internals/analytics/record-submit-step'; import { Flow, ProvidedDependencies } from './internals/types'; import type { OnboardSelect, UserSelect } from '@automattic/data-stores'; import type { MinimalRequestCartProduct } from '@automattic/shopping-cart'; @@ -63,8 +62,6 @@ const hosting: Flow = { }; const submit = ( providedDependencies: ProvidedDependencies = {} ) => { - recordSubmitStep( providedDependencies, '', flowName, _currentStepSlug ); - switch ( _currentStepSlug ) { case 'plans': { const productSlug = ( providedDependencies.plan as MinimalRequestCartProduct ) diff --git a/client/landing/stepper/declarative-flow/newsletter-post-setup.ts b/client/landing/stepper/declarative-flow/newsletter-post-setup.ts index 203b142a74a01..7c13b2767a157 100644 --- a/client/landing/stepper/declarative-flow/newsletter-post-setup.ts +++ b/client/landing/stepper/declarative-flow/newsletter-post-setup.ts @@ -1,7 +1,10 @@ +import { Onboard } from '@automattic/data-stores'; import { NEWSLETTER_POST_SETUP_FLOW } from '@automattic/onboarding'; +import { useDispatch } from '@wordpress/data'; +import { useEffect } from '@wordpress/element'; import { translate } from 'i18n-calypso'; import { useSiteSlug } from '../hooks/use-site-slug'; -import { recordSubmitStep } from './internals/analytics/record-submit-step'; +import { ONBOARD_STORE } from '../stores'; import NewsletterPostSetup from './internals/steps-repository/newsletter-post-setup'; import { ProvidedDependencies } from './internals/types'; import type { Flow } from './internals/types'; @@ -15,14 +18,17 @@ const newsletterPostSetup: Flow = { useSteps() { return [ { slug: 'newsletterPostSetup', component: NewsletterPostSetup } ]; }, + useSideEffect() { + const { setIntent } = useDispatch( ONBOARD_STORE ); + useEffect( () => { + setIntent( Onboard.SiteIntent.NewsletterPostSetup ); + }, [] ); + }, useStepNavigation( currentStep, navigate ) { - const flowName = this.name; const siteSlug = useSiteSlug(); function submit( providedDependencies: ProvidedDependencies = {} ) { - recordSubmitStep( providedDependencies, 'newsletter-post-setup', flowName, currentStep ); - switch ( currentStep ) { case 'newsletterPostSetup': return window.location.assign( diff --git a/client/landing/stepper/declarative-flow/newsletter.ts b/client/landing/stepper/declarative-flow/newsletter.ts index 332dfe3d8539f..a3082a9ffa78c 100644 --- a/client/landing/stepper/declarative-flow/newsletter.ts +++ b/client/landing/stepper/declarative-flow/newsletter.ts @@ -173,7 +173,6 @@ const newsletter: Flow = { return { goNext, goBack, goToStep, submit }; }, - use__Temporary__ShouldTrackEvent: ( event ) => 'submit' === event, }; export default newsletter; diff --git a/client/landing/stepper/declarative-flow/onboarding.ts b/client/landing/stepper/declarative-flow/onboarding.ts index b01f7f0621997..f46a94381f8f7 100644 --- a/client/landing/stepper/declarative-flow/onboarding.ts +++ b/client/landing/stepper/declarative-flow/onboarding.ts @@ -9,7 +9,6 @@ import { } from 'calypso/signup/storageUtils'; import { ONBOARD_STORE } from '../stores'; import { stepsWithRequiredLogin } from '../utils/steps-with-required-login'; -import { recordSubmitStep } from './internals/analytics/record-submit-step'; import { Flow, ProvidedDependencies } from './internals/types'; const onboarding: Flow = { @@ -56,8 +55,6 @@ const onboarding: Flow = { const { resetStore } = useDispatch( ONBOARD_STORE ); const submit = async ( providedDependencies: ProvidedDependencies = {} ) => { - recordSubmitStep( providedDependencies, '', flowName, currentStepSlug ); - switch ( currentStepSlug ) { case 'domains': return navigate( 'plans' ); diff --git a/client/landing/stepper/declarative-flow/plugin-bundle-flow.ts b/client/landing/stepper/declarative-flow/plugin-bundle-flow.ts index f2553bbae46e3..cf29d9b035a18 100644 --- a/client/landing/stepper/declarative-flow/plugin-bundle-flow.ts +++ b/client/landing/stepper/declarative-flow/plugin-bundle-flow.ts @@ -10,7 +10,6 @@ import { useSitePluginSlug } from '../hooks/use-site-plugin-slug'; import { useSiteSlugParam } from '../hooks/use-site-slug-param'; import { useCanUserManageOptions } from '../hooks/use-user-can-manage-options'; import { ONBOARD_STORE, SITE_STORE, USER_STORE } from '../stores'; -import { recordSubmitStep } from './internals/analytics/record-submit-step'; import { redirect } from './internals/steps-repository/import/util'; import { ProcessingResult } from './internals/steps-repository/processing-step/constants'; import { @@ -56,7 +55,6 @@ const pluginBundleFlow: Flow = { return [ ...initialBundleSteps, ...bundlePluginSteps ]; }, useStepNavigation( currentStep, navigate, steps = [] ) { - const flowName = this.name; const intent = useSelect( ( select ) => ( select( ONBOARD_STORE ) as OnboardSelect ).getIntent(), [] @@ -144,9 +142,8 @@ const pluginBundleFlow: Flow = { }; function submit( providedDependencies: ProvidedDependencies = {}, ...params: string[] ) { - recordSubmitStep( providedDependencies, intent, flowName, currentStep ); - let defaultExitDest = `/home/${ siteSlug }`; + if ( siteDetails?.options?.theme_slug ) { const themeId = getThemeIdFromStylesheet( siteDetails?.options?.theme_slug ); if ( isEnabled( 'themes/display-thank-you-page-for-bundle' ) ) { diff --git a/client/landing/stepper/declarative-flow/readymade-template.tsx b/client/landing/stepper/declarative-flow/readymade-template.tsx index 2ad068c283df6..11da7fe4e1387 100644 --- a/client/landing/stepper/declarative-flow/readymade-template.tsx +++ b/client/landing/stepper/declarative-flow/readymade-template.tsx @@ -2,7 +2,7 @@ import { Onboard, updateLaunchpadSettings } from '@automattic/data-stores'; import { getAssemblerDesign } from '@automattic/design-picker'; import { READYMADE_TEMPLATE_FLOW } from '@automattic/onboarding'; import { useQuery } from '@tanstack/react-query'; -import { useDispatch, useSelect } from '@wordpress/data'; +import { useDispatch } from '@wordpress/data'; import deepmerge from 'deepmerge'; import { useSelector } from 'react-redux'; import useUrlQueryParam from 'calypso/a8c-for-agencies/hooks/use-url-query-param'; @@ -17,7 +17,6 @@ import { CalypsoDispatch } from 'calypso/state/types'; import { useSiteData } from '../hooks/use-site-data'; import { ONBOARD_STORE, SITE_STORE } from '../stores'; import { stepsWithRequiredLogin } from '../utils/steps-with-required-login'; -import { recordSubmitStep } from './internals/analytics/record-submit-step'; import { STEPS } from './internals/steps'; import { ProcessingResult } from './internals/steps-repository/processing-step/constants'; import { @@ -28,7 +27,6 @@ import { ProvidedDependencies, StepperStep, } from './internals/types'; -import type { OnboardSelect } from '@automattic/data-stores'; import type { GlobalStylesObject } from '@automattic/global-styles'; import type { AnyAction } from 'redux'; import type { ThunkAction } from 'redux-thunk'; @@ -61,11 +59,6 @@ const readymadeTemplateFlow: Flow = { }, useStepNavigation( _currentStep, navigate ) { - const flowName = this.name; - const intent = useSelect( - ( select ) => ( select( ONBOARD_STORE ) as OnboardSelect ).getIntent(), - [] - ); const { setPendingAction, setSelectedSite, setSelectedReadymadeTemplate } = useDispatch( ONBOARD_STORE ); const { saveSiteSettings, setIntentOnSite, assembleSite } = useDispatch( SITE_STORE ); @@ -102,8 +95,6 @@ const readymadeTemplateFlow: Flow = { providedDependencies: ProvidedDependencies = {}, ...results: string[] ) => { - recordSubmitStep( providedDependencies, intent, flowName, _currentStep ); - switch ( _currentStep ) { /** * Check sites resets the onboarding store. diff --git a/client/landing/stepper/declarative-flow/reblogging.ts b/client/landing/stepper/declarative-flow/reblogging.ts index b972435e3c425..49659ea9227f1 100644 --- a/client/landing/stepper/declarative-flow/reblogging.ts +++ b/client/landing/stepper/declarative-flow/reblogging.ts @@ -8,7 +8,6 @@ import { setSignupCompleteFlowName, } from 'calypso/signup/storageUtils'; import { stepsWithRequiredLogin } from '../utils/steps-with-required-login'; -import { recordSubmitStep } from './internals/analytics/record-submit-step'; import type { Flow, ProvidedDependencies } from './internals/types'; const reblogging: Flow = { @@ -38,8 +37,6 @@ const reblogging: Flow = { triggerGuidesForStep( flowName, _currentStepSlug ); const submit = ( providedDependencies: ProvidedDependencies = {} ) => { - recordSubmitStep( providedDependencies, '', flowName, _currentStepSlug ); - switch ( _currentStepSlug ) { case 'domains': return navigate( 'plans' ); diff --git a/client/landing/stepper/declarative-flow/site-migration-flow.ts b/client/landing/stepper/declarative-flow/site-migration-flow.ts index 09aaa137d9675..63bcc14e50a93 100644 --- a/client/landing/stepper/declarative-flow/site-migration-flow.ts +++ b/client/landing/stepper/declarative-flow/site-migration-flow.ts @@ -487,7 +487,6 @@ const siteMigration: Flow = { return { goBack, submit, exitFlow }; }, - use__Temporary__ShouldTrackEvent: ( event ) => 'submit' === event, }; export default siteMigration; diff --git a/client/landing/stepper/declarative-flow/site-setup-flow.ts b/client/landing/stepper/declarative-flow/site-setup-flow.ts index 4bc7370bc5ac2..353fb9385b8ac 100644 --- a/client/landing/stepper/declarative-flow/site-setup-flow.ts +++ b/client/landing/stepper/declarative-flow/site-setup-flow.ts @@ -18,7 +18,6 @@ import { useSiteData } from '../hooks/use-site-data'; import { useCanUserManageOptions } from '../hooks/use-user-can-manage-options'; import { ONBOARD_STORE, SITE_STORE, USER_STORE, STEPPER_INTERNAL_STORE } from '../stores'; import { shouldRedirectToSiteMigration } from './helpers'; -import { recordSubmitStep } from './internals/analytics/record-submit-step'; import { STEPS } from './internals/steps'; import { redirect } from './internals/steps-repository/import/util'; import { ProcessingResult } from './internals/steps-repository/processing-step/constants'; @@ -94,7 +93,6 @@ const siteSetupFlow: Flow = { ]; }, useStepNavigation( currentStep, navigate ) { - const flowName = this.name; const stepData = useSelect( ( select ) => ( select( STEPPER_INTERNAL_STORE ) as StepperInternalSelect ).getStepData(), [] @@ -240,8 +238,6 @@ const siteSetupFlow: Flow = { }; function submit( providedDependencies: ProvidedDependencies = {}, ...params: string[] ) { - recordSubmitStep( providedDependencies, intent, flowName, currentStep ); - switch ( currentStep ) { case 'options': { if ( intent === 'sell' ) { diff --git a/client/landing/stepper/declarative-flow/start-writing.ts b/client/landing/stepper/declarative-flow/start-writing.ts index 1fc4cf6cb17d2..0acdb4ca6ec9a 100644 --- a/client/landing/stepper/declarative-flow/start-writing.ts +++ b/client/landing/stepper/declarative-flow/start-writing.ts @@ -3,7 +3,6 @@ import { START_WRITING_FLOW } from '@automattic/onboarding'; import { useDispatch } from '@wordpress/data'; import { useEffect } from '@wordpress/element'; import { translate } from 'i18n-calypso'; -import { recordSubmitStep } from 'calypso/landing/stepper/declarative-flow/internals/analytics/record-submit-step'; import { redirect } from 'calypso/landing/stepper/declarative-flow/internals/steps-repository/import/util'; import { type AssertConditionResult, @@ -76,7 +75,6 @@ const startWriting: Flow = { }, useStepNavigation( currentStep, navigate ) { - const flowName = this.name; const { saveSiteSettings, setIntentOnSite } = useDispatch( SITE_STORE ); const { setSelectedSite } = useDispatch( ONBOARD_STORE ); const { site, siteSlug, siteId } = useSiteData(); @@ -92,8 +90,6 @@ const startWriting: Flow = { }, [ siteSlug, setIntentOnSite, isSiteLaunched ] ); async function submit( providedDependencies: ProvidedDependencies = {} ) { - recordSubmitStep( providedDependencies, '', flowName, currentStep ); - switch ( currentStep ) { case 'check-sites': // Check for unlaunched sites diff --git a/client/landing/stepper/declarative-flow/tailored-ecommerce-flow.ts b/client/landing/stepper/declarative-flow/tailored-ecommerce-flow.ts index be47d8d7e707a..300ef4be15213 100644 --- a/client/landing/stepper/declarative-flow/tailored-ecommerce-flow.ts +++ b/client/landing/stepper/declarative-flow/tailored-ecommerce-flow.ts @@ -18,7 +18,6 @@ import { useSite } from '../hooks/use-site'; import { useSiteSlugParam } from '../hooks/use-site-slug-param'; import { USER_STORE, ONBOARD_STORE, SITE_STORE } from '../stores'; import getQuantityFromStorageType from '../utils/get-quantity-from-storage-slug'; -import { recordSubmitStep } from './internals/analytics/record-submit-step'; import { STEPS } from './internals/steps'; import { AssertConditionState } from './internals/types'; import type { Flow, ProvidedDependencies, AssertConditionResult } from './internals/types'; @@ -133,7 +132,6 @@ const ecommerceFlow: Flow = { const { getSiteIdBySlug } = useSelect( ( select ) => select( SITE_STORE ) as SiteSelect, [] ); function submit( providedDependencies: ProvidedDependencies = {} ) { - recordSubmitStep( providedDependencies, '', flowName, _currentStepName ); const siteSlug = ( providedDependencies?.siteSlug as string ) || siteSlugParam || ''; const siteId = getSiteIdBySlug( siteSlug ); diff --git a/client/landing/stepper/declarative-flow/transferring-hosted-site-flow.ts b/client/landing/stepper/declarative-flow/transferring-hosted-site-flow.ts index d997bd9b5efc9..f5c061929eb0c 100644 --- a/client/landing/stepper/declarative-flow/transferring-hosted-site-flow.ts +++ b/client/landing/stepper/declarative-flow/transferring-hosted-site-flow.ts @@ -4,7 +4,6 @@ import { useDispatch as useReduxDispatch } from 'react-redux'; import { requestAdminMenu } from 'calypso/state/admin-menu/actions'; import { useSiteIdParam } from '../hooks/use-site-id-param'; import { ONBOARD_STORE } from '../stores'; -import { recordSubmitStep } from './internals/analytics/record-submit-step'; import ErrorStep from './internals/steps-repository/error-step'; import ProcessingStep from './internals/steps-repository/processing-step'; import { ProcessingResult } from './internals/steps-repository/processing-step/constants'; @@ -27,7 +26,6 @@ const transferringHostedSite: Flow = { setProgress( 0 ); }, useStepNavigation( currentStep, navigate ) { - const flowName = this.name; const siteId = useSiteIdParam(); const dispatch = useReduxDispatch(); @@ -36,8 +34,6 @@ const transferringHostedSite: Flow = { }; function submit( providedDependencies: ProvidedDependencies = {}, ...params: string[] ) { - recordSubmitStep( providedDependencies, '', flowName, currentStep ); - switch ( currentStep ) { case 'processing': { const processingResult = params[ 0 ] as ProcessingResult; diff --git a/client/landing/stepper/declarative-flow/trial-wooexpress-flow.ts b/client/landing/stepper/declarative-flow/trial-wooexpress-flow.ts index f5b29142f50d2..5e96132a97250 100644 --- a/client/landing/stepper/declarative-flow/trial-wooexpress-flow.ts +++ b/client/landing/stepper/declarative-flow/trial-wooexpress-flow.ts @@ -8,13 +8,12 @@ import recordGTMDatalayerEvent from 'calypso/lib/analytics/ad-tracking/woo/recor import { logToLogstash } from 'calypso/lib/logstash'; import { useSiteSlugParam } from '../hooks/use-site-slug-param'; import { ONBOARD_STORE, SITE_STORE } from '../stores'; -import { recordSubmitStep } from './internals/analytics/record-submit-step'; import { STEPS } from './internals/steps'; import { AssignTrialResult } from './internals/steps-repository/assign-trial-plan/constants'; import { ProcessingResult } from './internals/steps-repository/processing-step/constants'; import { AssertConditionState } from './internals/types'; import type { AssertConditionResult, Flow, ProvidedDependencies } from './internals/types'; -import type { OnboardSelect, SiteSelect } from '@automattic/data-stores'; +import type { SiteSelect } from '@automattic/data-stores'; const wooexpress: Flow = { name: 'wooexpress', @@ -111,11 +110,6 @@ const wooexpress: Flow = { }, useStepNavigation( currentStep, navigate ) { - const flowName = this.name; - const intent = useSelect( - ( select ) => ( select( ONBOARD_STORE ) as OnboardSelect ).getIntent(), - [] - ); const siteSlugParam = useSiteSlugParam(); const { setPluginsToVerify } = useDispatch( ONBOARD_STORE ); @@ -131,7 +125,6 @@ const wooexpress: Flow = { }; function submit( providedDependencies: ProvidedDependencies = {}, ...params: string[] ) { - recordSubmitStep( providedDependencies, intent, flowName, currentStep ); const siteSlug = ( providedDependencies?.siteSlug as string ) || siteSlugParam || ''; const siteId = getSiteIdBySlug( siteSlug ); const adminUrl = siteId && getSiteOption( siteId, 'admin_url' ); diff --git a/client/landing/stepper/declarative-flow/update-design.ts b/client/landing/stepper/declarative-flow/update-design.ts index 068ad9835b291..ee8bcfd2e8752 100644 --- a/client/landing/stepper/declarative-flow/update-design.ts +++ b/client/landing/stepper/declarative-flow/update-design.ts @@ -1,6 +1,7 @@ -import { useLaunchpad } from '@automattic/data-stores'; +import { Onboard, useLaunchpad } from '@automattic/data-stores'; import { isAssemblerDesign } from '@automattic/design-picker'; import { useSelect, useDispatch } from '@wordpress/data'; +import { useEffect } from '@wordpress/element'; import { translate } from 'i18n-calypso'; import { setSignupCompleteSlug, @@ -10,7 +11,6 @@ import { import { useQuery } from '../hooks/use-query'; import { useSiteSlug } from '../hooks/use-site-slug'; import { ONBOARD_STORE } from '../stores'; -import { recordSubmitStep } from './internals/analytics/record-submit-step'; import { STEPS } from './internals/steps'; import { ProcessingResult } from './internals/steps-repository/processing-step/constants'; import { ProvidedDependencies } from './internals/types'; @@ -26,9 +26,14 @@ const updateDesign: Flow = { useSteps() { return [ STEPS.DESIGN_SETUP, STEPS.PATTERN_ASSEMBLER, STEPS.PROCESSING, STEPS.ERROR ]; }, + useSideEffect() { + const { setIntent } = useDispatch( ONBOARD_STORE ); + useEffect( () => { + setIntent( Onboard.SiteIntent.UpdateDesign ); + }, [] ); + }, useStepNavigation( currentStep, navigate ) { - const flowName = this.name; const siteSlug = useSiteSlug(); const flowToReturnTo = useQuery().get( 'flowToReturnTo' ) || 'free'; const { setPendingAction } = useDispatch( ONBOARD_STORE ); @@ -49,7 +54,6 @@ const updateDesign: Flow = { }; function submit( providedDependencies: ProvidedDependencies = {}, ...results: string[] ) { - recordSubmitStep( providedDependencies, 'update-design', flowName, currentStep ); switch ( currentStep ) { case 'processing': if ( results.some( ( result ) => result === ProcessingResult.FAILURE ) ) { diff --git a/client/landing/stepper/declarative-flow/update-options.ts b/client/landing/stepper/declarative-flow/update-options.ts index 37e8ba48d31a4..76019ce6cd236 100644 --- a/client/landing/stepper/declarative-flow/update-options.ts +++ b/client/landing/stepper/declarative-flow/update-options.ts @@ -1,6 +1,9 @@ +import { Onboard } from '@automattic/data-stores'; +import { useDispatch } from '@wordpress/data'; +import { useEffect } from '@wordpress/element'; import { useQuery } from '../hooks/use-query'; import { useSiteSlug } from '../hooks/use-site-slug'; -import { recordSubmitStep } from './internals/analytics/record-submit-step'; +import { ONBOARD_STORE } from '../stores'; import { STEPS } from './internals/steps'; import { ProcessingResult } from './internals/steps-repository/processing-step/constants'; import { ProvidedDependencies } from './internals/types'; @@ -12,14 +15,19 @@ const updateOptions: Flow = { useSteps() { return [ STEPS.OPTIONS, STEPS.PROCESSING, STEPS.ERROR ]; }, + useSideEffect() { + const { setIntent } = useDispatch( ONBOARD_STORE ); + useEffect( () => { + setIntent( Onboard.SiteIntent.UpdateOptions ); + }, [] ); + }, useStepNavigation( currentStep, navigate ) { - const flowName = this.name; const siteSlug = useSiteSlug(); const flowToReturnTo = useQuery().get( 'flowToReturnTo' ) || 'free'; + // eslint-disable-next-line @typescript-eslint/no-unused-vars function submit( providedDependencies: ProvidedDependencies = {}, ...results: string[] ) { - recordSubmitStep( providedDependencies, 'update-options', flowName, currentStep ); switch ( currentStep ) { case 'processing': if ( results.some( ( result ) => result === ProcessingResult.FAILURE ) ) { diff --git a/client/landing/stepper/declarative-flow/with-theme-assembler-flow.ts b/client/landing/stepper/declarative-flow/with-theme-assembler-flow.ts index 54561d836a204..55912fef980eb 100644 --- a/client/landing/stepper/declarative-flow/with-theme-assembler-flow.ts +++ b/client/landing/stepper/declarative-flow/with-theme-assembler-flow.ts @@ -8,7 +8,6 @@ import { useQueryTheme } from 'calypso/components/data/query-theme'; import { getTheme } from 'calypso/state/themes/selectors'; import { useSiteSlug } from '../hooks/use-site-slug'; import { ONBOARD_STORE } from '../stores'; -import { recordSubmitStep } from './internals/analytics/record-submit-step'; import { STEPS } from './internals/steps'; import { ProcessingResult } from './internals/steps-repository/processing-step/constants'; import { Flow, ProvidedDependencies } from './internals/types'; @@ -58,11 +57,6 @@ const withThemeAssemblerFlow: Flow = { }, useStepNavigation( _currentStep, navigate ) { - const flowName = this.name; - const intent = useSelect( - ( select ) => ( select( ONBOARD_STORE ) as OnboardSelect ).getIntent(), - [] - ); const { setPendingAction } = useDispatch( ONBOARD_STORE ); const siteSlug = useSiteSlug(); @@ -77,8 +71,6 @@ const withThemeAssemblerFlow: Flow = { }; const submit = ( providedDependencies: ProvidedDependencies = {}, ...results: string[] ) => { - recordSubmitStep( providedDependencies, intent, flowName, _currentStep ); - switch ( _currentStep ) { case 'processing': { if ( results.some( ( result ) => result === ProcessingResult.FAILURE ) ) { diff --git a/client/landing/stepper/declarative-flow/write.ts b/client/landing/stepper/declarative-flow/write.ts index 3da0eca9c78d3..542c15e8650cb 100644 --- a/client/landing/stepper/declarative-flow/write.ts +++ b/client/landing/stepper/declarative-flow/write.ts @@ -10,7 +10,6 @@ import { useSiteIdParam } from '../hooks/use-site-id-param'; import { useSiteSlug } from '../hooks/use-site-slug'; import { USER_STORE } from '../stores'; import { getLoginUrl } from '../utils/path'; -import { recordSubmitStep } from './internals/analytics/record-submit-step'; import LaunchPad from './internals/steps-repository/launchpad'; import Processing from './internals/steps-repository/processing-step'; import { @@ -42,8 +41,6 @@ const write: Flow = { triggerGuidesForStep( flowName, _currentStep ); const submit = ( providedDependencies: ProvidedDependencies = {} ) => { - recordSubmitStep( providedDependencies, '', flowName, _currentStep ); - switch ( _currentStep ) { case 'processing': if ( providedDependencies?.goToHome && providedDependencies?.siteSlug ) { diff --git a/packages/data-stores/src/onboard/constants.ts b/packages/data-stores/src/onboard/constants.ts index e44b44d8f4b6d..16af202ef104c 100644 --- a/packages/data-stores/src/onboard/constants.ts +++ b/packages/data-stores/src/onboard/constants.ts @@ -24,6 +24,10 @@ export enum SiteIntent { ReadyMadeTemplate = 'readymade-template', AIAssembler = 'ai-assembler', Newsletter = 'newsletter', - FreePostSetup = 'free-post-setup', + FreePostSetup = 'free-post-setup', // non-signup flow SiteMigration = 'site-migration', + LinkInBioPostSetup = 'link-in-bio-post-setup', // non-signup flow + NewsletterPostSetup = 'newsletter-post-setup', // non-signup flow + UpdateDesign = 'update-design', // non-signup flow + UpdateOptions = 'update-options', // non-signup flow }