Add versionCli

This commit is contained in:
Iván Ovejero 2022-09-06 12:52:14 +02:00
parent 9eba337d93
commit 592ecb3742
2 changed files with 6 additions and 4 deletions

View file

@ -43,6 +43,7 @@ export default mixins(externalHooks).extend({
instanceId: this.instanceId, instanceId: this.instanceId,
userId: this.currentUserId, userId: this.currentUserId,
store: this.$store, store: this.$store,
versionCli: this.$store.getters['settings/versionCli'],
}, },
); );

View file

@ -48,10 +48,11 @@ export class Telemetry {
init( init(
telemetrySettings: ITelemetrySettings, telemetrySettings: ITelemetrySettings,
{ instanceId, userId, store }: { { instanceId, userId, store, versionCli }: {
instanceId: string; instanceId: string;
userId?: string; userId?: string;
store: Store<IRootState>; store: Store<IRootState>;
versionCli: string
}, },
) { ) {
if (!telemetrySettings.enabled || !telemetrySettings.config || this.rudderStack) return; if (!telemetrySettings.enabled || !telemetrySettings.config || this.rudderStack) return;
@ -74,14 +75,14 @@ export class Telemetry {
}, },
); );
this.identify(instanceId, userId); this.identify(instanceId, userId, versionCli);
this.flushPageEvents(); this.flushPageEvents();
this.track('Session started', { session_id: store.getters.sessionId }); this.track('Session started', { session_id: store.getters.sessionId });
} }
identify(instanceId: string, userId?: string) { identify(instanceId: string, userId?: string, versionCli?: string) {
const traits = { instance_id: instanceId }; const traits = { instance_id: instanceId, version_cli: versionCli };
if (userId) { if (userId) {
this.rudderStack.identify(`${instanceId}#${userId}`, traits); this.rudderStack.identify(`${instanceId}#${userId}`, traits);
} }