-
Notifications
You must be signed in to change notification settings - Fork 549
feat(onboarding): funnel analytics for the new flow #7960
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import Utils from './utils' | ||
|
|
||
| export type OnboardingVariant = 'control' | 'single_page' | ||
|
|
||
| export const getOnboardingVariant = (): OnboardingVariant => | ||
| Utils.getFlagsmithHasFeature('onboarding_quickstart_flow') | ||
| ? 'single_page' | ||
| : 'control' | ||
|
Comment on lines
+5
to
+8
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How do we plan to release this one ? Should we directly have 2 variants in the feature and grab the variant name from the flag ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| export const isSinglePageOnboarding = (): boolean => | ||
| getOnboardingVariant() === 'single_page' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,20 @@ | ||
| import React, { FC } from 'react' | ||
| import Utils from 'common/utils/utils' | ||
| import React, { FC, useEffect } from 'react' | ||
| import { | ||
| getOnboardingVariant, | ||
| isSinglePageOnboarding, | ||
| } from 'common/utils/getOnboardingVariant' | ||
| import API from 'project/api' | ||
| import GettingStartedPage from 'components/pages/GettingStartedPage' | ||
| import OnboardingFlow from './OnboardingFlow' | ||
|
|
||
| // Gates /getting-started: renders the new onboarding flow when the | ||
| // `onboarding_quickstart_flow` flag is on, otherwise the existing page. | ||
| // | ||
| // Deliberately a flat file, not a folder + barrel - a one-line route gate with | ||
| // no styles or sub-parts, the documented exception to the component-folder | ||
| // convention (frontend/CLAUDE.md rule 8). | ||
| const GettingStartedGate: FC = () => | ||
| Utils.getFlagsmithHasFeature('onboarding_quickstart_flow') ? ( | ||
| <OnboardingFlow /> | ||
| ) : ( | ||
| <GettingStartedPage /> | ||
| ) | ||
| const GettingStartedGate: FC = () => { | ||
| const variant = getOnboardingVariant() | ||
|
|
||
| useEffect(() => { | ||
| API.trackTraits({ onboarding_variant: variant }) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tagged at the gate (only users who reach onboarding). |
||
| }, [variant]) | ||
|
|
||
| return isSinglePageOnboarding() ? <OnboardingFlow /> : <GettingStartedPage /> | ||
| } | ||
|
|
||
| export default GettingStartedGate | ||
Uh oh!
There was an error while loading. Please reload this page.