Skip to content

Commit 64f4edf

Browse files
author
arthosofteq
authored
Merge pull request #377 from RedisInsight/bugfix/RI-2499-avoid_using_common_id_for_non_tracking
Avoid using common id for non-tracking events such as APPLICATION_STA…
2 parents 8334771 + 661e132 commit 64f4edf

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

redisinsight/api/src/modules/core/services/analytics/analytics.service.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ describe('AnalyticsService', () => {
115115
});
116116

117117
expect(mockAnalyticsTrack).toHaveBeenCalledWith({
118-
anonymousId: NON_TRACKING_ANONYMOUS_ID,
118+
anonymousId: mockAnonymousId,
119119
integrations: { Amplitude: { session_id: sessionId } },
120120
event: TelemetryEvents.ApplicationStarted,
121121
properties: {},

redisinsight/api/src/modules/core/services/analytics/analytics.service.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export class AnalyticsService {
6161
'agreements.analytics',
6262
false,
6363
);
64-
if (isAnalyticsGranted) {
64+
if (isAnalyticsGranted || nonTracking) {
6565
this.analytics.track({
6666
anonymousId: this.anonymousId,
6767
integrations: { Amplitude: { session_id: this.sessionId } },
@@ -70,15 +70,6 @@ export class AnalyticsService {
7070
...eventData,
7171
},
7272
});
73-
} else if (nonTracking) {
74-
this.analytics.track({
75-
anonymousId: NON_TRACKING_ANONYMOUS_ID,
76-
integrations: { Amplitude: { session_id: this.sessionId } },
77-
event,
78-
properties: {
79-
...eventData,
80-
},
81-
});
8273
}
8374
} catch (e) {
8475
// continue regardless of error

0 commit comments

Comments
 (0)