mirror of
https://github.com/n8n-io/n8n.git
synced 2026-06-01 09:17:08 +02:00
fix: Fixes filtering session recordings based on group properties (no-changelog) (#30634)
This commit is contained in:
parent
3fca302df2
commit
7a7d8a615e
|
|
@ -96,6 +96,7 @@ declare global {
|
|||
userPropertiesOnce?: Record<string, string>,
|
||||
): void;
|
||||
reset?(resetDeviceId?: boolean): void;
|
||||
group?(groupType: string, groupKey: string, groupPropertiesToSet?: IDataObject): void;
|
||||
onFeatureFlags?(callback: (keys: string[], map: FeatureFlags) => void): void;
|
||||
reloadFeatureFlags?(): void;
|
||||
capture?(event: string, properties: IDataObject): void;
|
||||
|
|
|
|||
|
|
@ -64,11 +64,16 @@ export class Telemetry {
|
|||
});
|
||||
|
||||
this.identify({ instanceId, userId, versionCli, projectId, userRole });
|
||||
this.groupIdentify({ instanceId });
|
||||
|
||||
this.flushPageEvents();
|
||||
this.track('Session started', { session_id: rootStore.pushRef });
|
||||
}
|
||||
|
||||
groupIdentify({ instanceId }: { instanceId: string }) {
|
||||
usePostHog()?.groupIdentify?.('company', instanceId);
|
||||
}
|
||||
|
||||
identify({ instanceId, userId, versionCli, projectId, userRole }: TelemetryIdentifyOptions) {
|
||||
const settingsStore = useSettingsStore();
|
||||
const traits: {
|
||||
|
|
|
|||
|
|
@ -114,6 +114,10 @@ export const usePostHog = defineStore('posthog', () => {
|
|||
};
|
||||
}
|
||||
|
||||
const groupIdentify = (groupKey: string, instanceId: string) => {
|
||||
window.posthog?.group?.(groupKey, instanceId);
|
||||
};
|
||||
|
||||
const identify = () => {
|
||||
const instanceId = rootStore.instanceId;
|
||||
const user = usersStore.currentUser;
|
||||
|
|
@ -233,6 +237,7 @@ export const usePostHog = defineStore('posthog', () => {
|
|||
waitForFeatureFlags,
|
||||
reset,
|
||||
identify,
|
||||
groupIdentify,
|
||||
setMetadata,
|
||||
capture,
|
||||
overrides,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user