@@ -6,9 +6,10 @@ import isGlob from 'is-glob'
6
6
import * as jsonpath from 'jsonpath'
7
7
import { Nullable } from 'uiSrc/utils'
8
8
import { localStorageService } from 'uiSrc/services'
9
- import { ApiEndpoints , BrowserStorageItem , KeyTypes } from 'uiSrc/constants'
9
+ import { ApiEndpoints , BrowserStorageItem , KeyTypes , StreamViews } from 'uiSrc/constants'
10
10
import { KeyViewType } from 'uiSrc/slices/interfaces/keys'
11
- import { checkIsAnalyticsGranted } from 'uiSrc/telemetry/checkAnalytics'
11
+ import { StreamViewType } from 'uiSrc/slices/interfaces/stream'
12
+ import { checkIsAnalyticsGranted , getAppType } from 'uiSrc/telemetry/checkAnalytics'
12
13
import { ITelemetrySendEvent , ITelemetrySendPageView , ITelemetryService , MatchType } from './interfaces'
13
14
import { TelemetryEvent } from './events'
14
15
import { NON_TRACKING_ANONYMOUS_ID , SegmentTelemetryService } from './segment'
@@ -50,10 +51,13 @@ const sendEventTelemetry = (payload: ITelemetrySendEvent) => {
50
51
const isAnalyticsGranted = checkIsAnalyticsGranted ( )
51
52
setAnonymousId ( isAnalyticsGranted )
52
53
54
+ const appType = getAppType ( )
55
+
53
56
if ( isAnalyticsGranted || nonTracking ) {
54
57
telemetryService ?. event ( {
55
58
event,
56
59
properties : {
60
+ buildType : appType ,
57
61
...eventData ,
58
62
} ,
59
63
} )
@@ -72,9 +76,10 @@ const sendPageViewTelemetry = (payload: ITelemetrySendPageView) => {
72
76
73
77
const isAnalyticsGranted = checkIsAnalyticsGranted ( )
74
78
setAnonymousId ( isAnalyticsGranted )
79
+ const appType = getAppType ( )
75
80
76
81
if ( isAnalyticsGranted || nonTracking ) {
77
- telemetryService ?. pageView ( name , databaseId )
82
+ telemetryService ?. pageView ( name , appType , databaseId )
78
83
}
79
84
}
80
85
@@ -164,6 +169,16 @@ const getMatchType = (match: string): MatchType => (
164
169
: MatchType . PATTERN
165
170
)
166
171
172
+ export const getRefreshEventData = ( eventData : any , type : string , streamViewType ?: StreamViewType ) => {
173
+ if ( type === KeyTypes . Stream ) {
174
+ return {
175
+ ...eventData ,
176
+ streamView : StreamViews [ streamViewType ! ]
177
+ }
178
+ }
179
+ return eventData
180
+ }
181
+
167
182
export {
168
183
getTelemetryService ,
169
184
sendEventTelemetry ,
0 commit comments