Skip to content

Commit

Permalink
Stepper: Update connect-domain flow to use framework tracking for s…
Browse files Browse the repository at this point in the history
…ubmit-step (#93275)
  • Loading branch information
chriskmnds authored Aug 22, 2024
1 parent c509b20 commit eb03c56
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions client/landing/stepper/declarative-flow/connect-domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import {
persistSignupDestination,
setSignupCompleteFlowName,
} from 'calypso/signup/storageUtils';
import { STEPPER_TRACKS_EVENT_STEP_NAV_SUBMIT } from '../constants';
import { useDomainParams } from '../hooks/use-domain-params';
import { USER_STORE, ONBOARD_STORE } from '../stores';
import { useLoginUrl } from '../utils/path';
import { recordSubmitStep } from './internals/analytics/record-submit-step';
import { redirect } from './internals/steps-repository/import/util';
import {
AssertConditionResult,
Expand Down Expand Up @@ -106,18 +106,23 @@ const connectDomain: Flow = {
useSteps() {
return CONNECT_DOMAIN_STEPS;
},
useTracksEventProps() {
const { domain, provider } = useDomainParams();

return {
[ STEPPER_TRACKS_EVENT_STEP_NAV_SUBMIT ]: {
domain,
provider,
},
};
},
useStepNavigation( _currentStepSlug, navigate ) {
const flowName = this.name;
const { domain, provider } = useDomainParams();
const { domain } = useDomainParams();

triggerGuidesForStep( flowName, _currentStepSlug );

const submit = ( providedDependencies: ProvidedDependencies = {} ) => {
recordSubmitStep( providedDependencies, '', flowName, _currentStepSlug, undefined, {
provider,
domain,
} );

switch ( _currentStepSlug ) {
case 'plans':
clearSignupDestinationCookie();
Expand Down Expand Up @@ -147,6 +152,7 @@ const connectDomain: Flow = {
submit,
};
},
use__Temporary__ShouldTrackEvent: ( event ) => 'submit' === event,
};

export default connectDomain;

0 comments on commit eb03c56

Please sign in to comment.