diff options
author | Stefan Malzner <stefan@adlk.io> | 2019-10-15 22:28:44 +0200 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2019-10-15 22:28:44 +0200 |
commit | 939c00860ae65231070338b5bc0b09db7af0e149 (patch) | |
tree | 9f9b5f1f84967f1185af7f0848f1142a92f36e42 /src/features/planSelection/containers/PlanSelectionScreen.js | |
parent | remove console log (diff) | |
download | ferdium-app-939c00860ae65231070338b5bc0b09db7af0e149.tar.gz ferdium-app-939c00860ae65231070338b5bc0b09db7af0e149.tar.zst ferdium-app-939c00860ae65231070338b5bc0b09db7af0e149.zip |
plan selection polishing
Diffstat (limited to 'src/features/planSelection/containers/PlanSelectionScreen.js')
-rw-r--r-- | src/features/planSelection/containers/PlanSelectionScreen.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/features/planSelection/containers/PlanSelectionScreen.js b/src/features/planSelection/containers/PlanSelectionScreen.js index b0d9b5ab5..01b357861 100644 --- a/src/features/planSelection/containers/PlanSelectionScreen.js +++ b/src/features/planSelection/containers/PlanSelectionScreen.js | |||
@@ -8,7 +8,8 @@ import FeaturesStore from '../../../stores/FeaturesStore'; | |||
8 | import UserStore from '../../../stores/UserStore'; | 8 | import UserStore from '../../../stores/UserStore'; |
9 | import PlanSelection from '../components/PlanSelection'; | 9 | import PlanSelection from '../components/PlanSelection'; |
10 | import ErrorBoundary from '../../../components/util/ErrorBoundary'; | 10 | import ErrorBoundary from '../../../components/util/ErrorBoundary'; |
11 | import { planSelectionStore } from '..'; | 11 | import { planSelectionStore, GA_CATEGORY_PLAN_SELECTION } from '..'; |
12 | import { gaEvent } from '../../../lib/analytics'; | ||
12 | 13 | ||
13 | const { dialog, app } = remote; | 14 | const { dialog, app } = remote; |
14 | 15 | ||
@@ -37,6 +38,10 @@ class PlanSelectionScreen extends Component { | |||
37 | intl: intlShape, | 38 | intl: intlShape, |
38 | }; | 39 | }; |
39 | 40 | ||
41 | componentDidMount() { | ||
42 | gaEvent(GA_CATEGORY_PLAN_SELECTION, 'show'); | ||
43 | } | ||
44 | |||
40 | upgradeAccount(planId) { | 45 | upgradeAccount(planId) { |
41 | const { user, features } = this.props.stores; | 46 | const { user, features } = this.props.stores; |
42 | const { upgradeAccount, hideOverlay } = this.props.actions.planSelection; | 47 | const { upgradeAccount, hideOverlay } = this.props.actions.planSelection; |
@@ -83,6 +88,8 @@ class PlanSelectionScreen extends Component { | |||
83 | upgradeAccount={(planId) => { | 88 | upgradeAccount={(planId) => { |
84 | if (user.data.hadSubscription) { | 89 | if (user.data.hadSubscription) { |
85 | this.upgradeAccount(planId); | 90 | this.upgradeAccount(planId); |
91 | |||
92 | gaEvent(GA_CATEGORY_PLAN_SELECTION, 'SelectPlan', planId); | ||
86 | } else { | 93 | } else { |
87 | activateTrial({ | 94 | activateTrial({ |
88 | planId, | 95 | planId, |
@@ -103,11 +110,15 @@ class PlanSelectionScreen extends Component { | |||
103 | ], | 110 | ], |
104 | }); | 111 | }); |
105 | 112 | ||
113 | gaEvent(GA_CATEGORY_PLAN_SELECTION, 'SelectPlan', 'Stay on Free'); | ||
114 | |||
106 | if (selection === 0) { | 115 | if (selection === 0) { |
107 | downgradeAccount(); | 116 | downgradeAccount(); |
108 | hideOverlay(); | 117 | hideOverlay(); |
109 | } else { | 118 | } else { |
110 | upgradeAccount(plans.personal.yearly.id); | 119 | upgradeAccount(plans.personal.yearly.id); |
120 | |||
121 | gaEvent(GA_CATEGORY_PLAN_SELECTION, 'SelectPlan', 'Revoke'); | ||
111 | } | 122 | } |
112 | }} | 123 | }} |
113 | subscriptionExpired={user.team && user.team.state === 'expired' && !user.team.userHasDowngraded} | 124 | subscriptionExpired={user.team && user.team.state === 'expired' && !user.team.userHasDowngraded} |