diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-07-12 06:39:12 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-07-12 06:39:12 +0800 |
commit | 098322c56475581df5bd80e12cb6c511963e4daf (patch) | |
tree | bed34b4b9b9be4ea124a7a3247db02e8e39d7ba2 /packages/website/ts/components/forms | |
parent | 9131a72a47690912db9b536186d05120daabd115 (diff) | |
download | dexon-0x-contracts-098322c56475581df5bd80e12cb6c511963e4daf.tar.gz dexon-0x-contracts-098322c56475581df5bd80e12cb6c511963e4daf.tar.zst dexon-0x-contracts-098322c56475581df5bd80e12cb6c511963e4daf.zip |
Integrate heap analytics
Diffstat (limited to 'packages/website/ts/components/forms')
-rw-r--r-- | packages/website/ts/components/forms/subscribe_form.tsx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/website/ts/components/forms/subscribe_form.tsx b/packages/website/ts/components/forms/subscribe_form.tsx index 8ef58328e..19abbdf5f 100644 --- a/packages/website/ts/components/forms/subscribe_form.tsx +++ b/packages/website/ts/components/forms/subscribe_form.tsx @@ -6,6 +6,7 @@ import { Button } from 'ts/components/ui/button'; import { Container } from 'ts/components/ui/container'; import { Input } from 'ts/components/ui/input'; import { Text } from 'ts/components/ui/text'; +import { analytics } from 'ts/utils/analytics'; import { backendClient } from 'ts/utils/backend_client'; export interface SubscribeFormProps {} @@ -112,6 +113,9 @@ export class SubscribeForm extends React.Component<SubscribeFormProps, Subscribe try { const response = await backendClient.subscribeToNewsletterAsync(this.state.emailText); const status = response.status === 200 ? SubscribeFormStatus.Success : SubscribeFormStatus.Error; + if (status === SubscribeFormStatus.Success) { + analytics.indentifyAsync(this.state.emailText, 'email'); + } this.setState({ status, emailText: '' }); } catch (error) { this._setStatus(SubscribeFormStatus.Error); |