Browse Source

capture some events on the onboarding for analytics

master
Anastasia Poupeney 7 years ago
parent
commit
cb648b8569
  1. 17
      src/components/Onboarding/steps/Analytics.js
  2. 2
      src/components/Onboarding/steps/GenuineCheck/GenuineCheckUnavailable.js
  3. 9
      src/components/Onboarding/steps/SetPassword.js
  4. 5
      src/components/SettingsPage/sections/Profile.js
  5. 4
      src/middlewares/analytics.js

17
src/components/Onboarding/steps/Analytics.js

@ -7,6 +7,7 @@ import { saveSettings } from 'actions/settings'
import Box from 'components/base/Box' import Box from 'components/base/Box'
import CheckBox from 'components/base/CheckBox' import CheckBox from 'components/base/CheckBox'
import TrackPage from 'analytics/TrackPage' import TrackPage from 'analytics/TrackPage'
import Track from 'analytics/Track'
import { Title, Description, FixedTopContainer, StepContainerInner } from '../helperComponents' import { Title, Description, FixedTopContainer, StepContainerInner } from '../helperComponents'
import OnboardingFooter from '../OnboardingFooter' import OnboardingFooter from '../OnboardingFooter'
@ -68,6 +69,14 @@ class Analytics extends PureComponent<StepProps, State> {
<AnalyticsText>{t('onboarding:analytics.sentryLogs.desc')}</AnalyticsText> <AnalyticsText>{t('onboarding:analytics.sentryLogs.desc')}</AnalyticsText>
</Box> </Box>
<Box justifyContent="center"> <Box justifyContent="center">
<Track
onUpdate
event={
sentryLogsToggle
? 'Sentry Logs Enabled Onboarding'
: 'Sentry Logs Disabled Onboarding'
}
/>
<CheckBox isChecked={sentryLogsToggle} onChange={this.handleSentryLogsToggle} /> <CheckBox isChecked={sentryLogsToggle} onChange={this.handleSentryLogsToggle} />
</Box> </Box>
</Container> </Container>
@ -77,6 +86,14 @@ class Analytics extends PureComponent<StepProps, State> {
<AnalyticsText>{t('onboarding:analytics.shareAnalytics.desc')}</AnalyticsText> <AnalyticsText>{t('onboarding:analytics.shareAnalytics.desc')}</AnalyticsText>
</Box> </Box>
<Box justifyContent="center"> <Box justifyContent="center">
<Track
onUpdate
event={
analyticsToggle
? 'Analytics Enabled Onboarding'
: 'Analytics Disabled Onboarding'
}
/>
<CheckBox isChecked={analyticsToggle} onChange={this.handleAnalyticsToggle} /> <CheckBox isChecked={analyticsToggle} onChange={this.handleAnalyticsToggle} />
</Box> </Box>
</Container> </Container>

2
src/components/Onboarding/steps/GenuineCheck/GenuineCheckUnavailable.js

@ -36,7 +36,7 @@ export function GenuineCheckUnavailableFooter({
<Button <Button
padded padded
disabled={false} disabled={false}
event="Skip Genuine Check" event="Skip Genuine Check Onboarding"
onClick={() => nextStep()} onClick={() => nextStep()}
mx={2} mx={2}
> >

9
src/components/Onboarding/steps/SetPassword.js

@ -135,7 +135,14 @@ class SetPassword extends PureComponent<StepProps, State> {
{t('app:common.back')} {t('app:common.back')}
</Button> </Button>
<Box horizontal ml="auto"> <Box horizontal ml="auto">
<Button padded disabled={false} onClick={() => nextStep()} mx={2}> <Button
padded
event="Skip Password Onboarding"
onClick={() => nextStep()}
disabled={false}
onClick={() => nextStep()}
mx={2}
>
{t('app:common.skipThisStep')} {t('app:common.skipThisStep')}
</Button> </Button>
<Button <Button

5
src/components/SettingsPage/sections/Profile.js

@ -192,7 +192,10 @@ class TabProfile extends PureComponent<Props, State> {
title={t('app:settings.profile.analytics')} title={t('app:settings.profile.analytics')}
desc={t('app:settings.profile.analyticsDesc')} desc={t('app:settings.profile.analyticsDesc')}
> >
<Track onUpdate event={settings.sentryLogs ? 'SentryEnabled' : 'SentryDisabled'} /> <Track
onUpdate
event={settings.shareAnalytics ? 'AnalyticsEnabled' : 'AnalyticsDisabled'}
/>
<CheckBox <CheckBox
isChecked={settings.shareAnalytics} isChecked={settings.shareAnalytics}
onChange={shareAnalytics => saveSettings({ shareAnalytics })} onChange={shareAnalytics => saveSettings({ shareAnalytics })}

4
src/middlewares/analytics.js

@ -1,5 +1,5 @@
import { shareAnalyticsSelector } from 'reducers/settings' import { shareAnalyticsSelector } from 'reducers/settings'
import { start, stop } from 'analytics/segment' import { start, stop, track } from 'analytics/segment'
let isAnalyticsStarted = false let isAnalyticsStarted = false
@ -12,6 +12,8 @@ export default store => next => action => {
if (shareAnalytics) { if (shareAnalytics) {
start(store) start(store)
} else { } else {
//TODO add user uuid
track('Stopping Analytics')
stop() stop()
} }
} }

Loading…
Cancel
Save