diff --git a/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js b/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js index c05242715..639c929c1 100644 --- a/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js +++ b/src/OnboardingSPA/components/NewfoldInterfaceSkeleton/SiteBuild/index.js @@ -19,6 +19,7 @@ import NewfoldInterfaceSkeleton from '../index'; import { ThemeProvider } from '../../ThemeContextProvider'; import { stepTheFork } from '../../../steps/TheFork/step'; import { stepSiteGenMigration } from '../../../steps/SiteGen/Migration/step'; +import { useWPSettings as getWPSettings } from '../../../steps/Ecommerce/useWPSettings'; // classes import { HiiveAnalytics } from '@newfold-labs/js-utility-ui-analytics'; @@ -64,6 +65,7 @@ import { ACTION_MIGRATION_INITIATED, ACTION_PAGEVIEW, CATEGORY, + ACTION_MFE_MIGRATION_INITIATED, } from '../../../utils/analytics/hiive/constants'; import { socialMediaStoreToState } from '../../SocialMediaForm/utils'; @@ -387,12 +389,12 @@ const SiteBuild = () => { const trackInstaWpMigrationEvent = () => { if ( currentStep?.path === stepSiteGenMigration?.path ) { if ( instaWpMigrationUrl ) { - sendOnboardingEvent( + getWPSettings().then( ( res ) => sendOnboardingEvent( new OnboardingEvent( - ACTION_MIGRATION_INITIATED, + res.nfd_migrate_site ? ACTION_MFE_MIGRATION_INITIATED : ACTION_MIGRATION_INITIATED, instaWpMigrationUrl ) - ); + ) ); } } }; diff --git a/src/OnboardingSPA/utils/analytics/hiive/constants.js b/src/OnboardingSPA/utils/analytics/hiive/constants.js index 21157f837..e68920cd7 100644 --- a/src/OnboardingSPA/utils/analytics/hiive/constants.js +++ b/src/OnboardingSPA/utils/analytics/hiive/constants.js @@ -21,6 +21,7 @@ export const ACTION_ONBOARDING_CHAPTER_STARTED = 'onboarding_chapter_started'; export const ACTION_ONBOARDING_CHAPTER_COMPLETE = 'onboarding_chapter_complete'; export const ACTION_SOCIAL_ADDED = 'social_added'; export const ACTION_MIGRATION_INITIATED = 'migration_initiated'; +export const ACTION_MFE_MIGRATION_INITIATED = 'mfe_migration_initiated'; export const ACTION_SITEGEN_FORK_OPTION_SELECTED = 'fork_option_selected'; export const ACTION_SITEGEN_SITE_DETAILS_PROMPT_SET = 'site_details_prompt_set'; @@ -66,5 +67,6 @@ export const ACTION_TO_LABEL_KEY_MAP = { [ ACTION_SITEGEN_HOMEPAGE_RENAMED ]: 'version', [ ACTION_SITEGEN_SITE_GENERATION_TIME ]: 'time', [ ACTION_MIGRATION_INITIATED ]: 'path', + [ ACTION_MFE_MIGRATION_INITIATED ]: 'path', [ ACTION_SITEGEN_ERROR_STATE_TRIGGERED ]: 'identifier', };