Skip to content

Commit

Permalink
Add a tracks event for the skip button in domain step test (#37823)
Browse files Browse the repository at this point in the history
* Add a tracks event for the skip button in domain step test

* Re-use an existing event instead of creating a new Tracks event
  • Loading branch information
niranjan-uma-shankar committed Nov 22, 2019
1 parent fe47677 commit 1cbc470
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions client/signup/steps/domains/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,23 @@ class DomainsStep extends React.Component {
return `${ repo }/${ themeSlug }`;
};

handleSkip = () => {
const domainItem = undefined;
handleSkip = ( googleAppsCartItem, shouldHideFreePlan = false ) => {
const hideFreePlanTracksProp = this.showTestCopy
? { should_hide_free_plan: shouldHideFreePlan }
: {};

const tracksProperties = Object.assign(
{
section: this.getAnalyticsSection(),
flow: this.props.flowName,
step: this.props.stepName,
},
hideFreePlanTracksProp
);

this.props.submitSignupStep( { stepName: this.props.stepName, domainItem }, { domainItem } );
this.props.goToNextStep();
this.props.recordTracksEvent( 'calypso_signup_skip_step', tracksProperties );

this.submitWithDomain( googleAppsCartItem, shouldHideFreePlan );
};

submitWithDomain = ( googleAppsCartItem, shouldHideFreePlan = false ) => {
Expand Down Expand Up @@ -438,7 +450,7 @@ class DomainsStep extends React.Component {
showSkipButton={ this.props.showSkipButton }
vertical={ this.props.vertical }
onSkip={ this.handleSkip }
hideFreePlan={ this.submitWithDomain }
hideFreePlan={ this.handleSkip }
/>
);
};
Expand Down Expand Up @@ -698,6 +710,7 @@ export default connect(
setDesignType,
saveSignupStep,
submitSignupStep,
recordTracksEvent,
fetchUsernameSuggestion,
hideSitePreview,
showSitePreview,
Expand Down

0 comments on commit 1cbc470

Please sign in to comment.