diff --git a/satellite/analytics/service.go b/satellite/analytics/service.go index ab9a0f8aa..477b101d1 100644 --- a/satellite/analytics/service.go +++ b/satellite/analytics/service.go @@ -20,6 +20,7 @@ const ( eventPassphraseCreated = "Passphrase Created" eventExternalLinkClicked = "External Link Clicked" eventPathSelected = "Path Selected" + eventLinkShared = "Link Shared" ) // Config is a configuration struct for analytics Service. @@ -51,7 +52,7 @@ func NewService(log *zap.Logger, config Config, satelliteName string) *Service { if config.Enabled { service.segment = segment.New(config.SegmentWriteKey) } - for _, name := range []string{eventGatewayCredentialsCreated, eventPassphraseCreated, eventExternalLinkClicked, eventPathSelected} { + for _, name := range []string{eventGatewayCredentialsCreated, eventPassphraseCreated, eventExternalLinkClicked, eventPathSelected, eventLinkShared} { service.clientEvents[name] = true } return service diff --git a/web/satellite/package-lock.json b/web/satellite/package-lock.json index 0e00b91e3..8b7c7cd77 100644 --- a/web/satellite/package-lock.json +++ b/web/satellite/package-lock.json @@ -18505,4 +18505,4 @@ "dev": true } } -} +} \ No newline at end of file diff --git a/web/satellite/src/components/objects/UploadFile.vue b/web/satellite/src/components/objects/UploadFile.vue index c24e529d3..2d02fa1b3 100644 --- a/web/satellite/src/components/objects/UploadFile.vue +++ b/web/satellite/src/components/objects/UploadFile.vue @@ -19,6 +19,9 @@ import { ACCESS_GRANTS_ACTIONS } from '@/store/modules/accessGrants'; import { AccessGrant, GatewayCredentials } from '@/types/accessGrants'; import { MetaUtils } from '@/utils/meta'; +import { AnalyticsEvent } from '@/utils/constants/analyticsEventNames'; +import { AnalyticsHttpApi } from '@/api/analytics'; + @Component({ components: { FileBrowser, @@ -27,6 +30,7 @@ import { MetaUtils } from '@/utils/meta'; export default class UploadFile extends Vue { private linksharingURL = ''; private worker: Worker; + private readonly analytics: AnalyticsHttpApi = new AnalyticsHttpApi(); /** * Lifecycle hook after initial render. @@ -101,6 +105,8 @@ export default class UploadFile extends Vue { path = encodeURIComponent(path.trim()); + await this.analytics.eventTriggered(AnalyticsEvent.LINK_SHARED); + return `${this.linksharingURL}/${key}/${path}`; } catch (error) { await this.$notify.error(error.message); diff --git a/web/satellite/src/utils/constants/analyticsEventNames.ts b/web/satellite/src/utils/constants/analyticsEventNames.ts index e635dade1..5565bb1c3 100644 --- a/web/satellite/src/utils/constants/analyticsEventNames.ts +++ b/web/satellite/src/utils/constants/analyticsEventNames.ts @@ -7,4 +7,5 @@ export enum AnalyticsEvent { PASSPHRASE_CREATED = 'Passphrase Created', EXTERNAL_LINK_CLICKED = 'External Link Clicked', PATH_SELECTED = 'Path Selected', + LINK_SHARED = 'Link Shared', }