web/satellite: add segment event for Generate Gateway Credentials button

WHAT:
we want to track how many people click Generate Gateway Credentials button

WHY:
user tracking

Change-Id: Iad6a38a552f5773bbea7c07bac3562365a5f57d9
This commit is contained in:
VitaliiShpital 2021-02-08 16:48:13 +02:00 committed by Vitalii Shpital
parent fcd18ef48a
commit 570dcfad3e
3 changed files with 11 additions and 1 deletions

View File

@ -47,7 +47,7 @@
<HeaderedInput
class="create-passphrase__value-area__password__input"
label="Create Your Passphrase"
placeholder="Enter your passphrase here"
placeholder="Strong passphrases contain 12 characters or more"
@setData="onChangePassphrase"
:error="errorMessage"
/>

View File

@ -122,6 +122,7 @@ import HideIcon from '@/../static/images/common/BlackArrowHide.svg';
import { RouteConfig } from '@/router';
import { ACCESS_GRANTS_ACTIONS } from '@/store/modules/accessGrants';
import { GatewayCredentials } from '@/types/accessGrants';
import { SegmentEvent } from '@/utils/constants/analyticsEventNames';
import { MetaUtils } from '@/utils/meta';
@Component({
@ -274,6 +275,14 @@ export default class ResultStep extends Vue {
await this.$notify.success('Gateway credentials were generated successfully');
this.areKeysVisible = true;
const satelliteName: string = MetaUtils.getMetaContent('satellite-name');
this.$segment.track(SegmentEvent.GENERATE_GATEWAY_CREDENTIALS_CLICKED, {
satelliteName: satelliteName,
email: this.$store.getters.user.email,
});
this.isLoading = false;
} catch (error) {
await this.$notify.error(error.message);

View File

@ -19,4 +19,5 @@ export enum SegmentEvent {
TEAM_MEMBER_INVITED = 'Team Member Invited',
TEAM_VIEWED = 'Team Viewed',
CLI_DOCS_VIEWED = 'Uplink CLI Docs Viewed',
GENERATE_GATEWAY_CREDENTIALS_CLICKED = 'Generate Gateway Credentials Clicked',
}