diff --git a/packages/editor-ui/src/components/AskAssistant/AskAssistantFloatingButton.vue b/packages/editor-ui/src/components/AskAssistant/AskAssistantFloatingButton.vue index b7fa424af..853dd960f 100644 --- a/packages/editor-ui/src/components/AskAssistant/AskAssistantFloatingButton.vue +++ b/packages/editor-ui/src/components/AskAssistant/AskAssistantFloatingButton.vue @@ -28,16 +28,12 @@ const lastUnread = computed(() => { const onClick = () => { assistantStore.openChat(); - telemetry.track( - 'User opened assistant', - { - source: 'canvas', - task: 'placeholder', - has_existing_session: !assistantStore.isSessionEnded, - workflow_id: workflowStore.workflowId, - }, - { withPostHog: true }, - ); + telemetry.track('User opened assistant', { + source: 'canvas', + task: 'placeholder', + has_existing_session: !assistantStore.isSessionEnded, + workflow_id: workflowStore.workflowId, + }); }; diff --git a/packages/editor-ui/src/components/AskAssistant/NewAssistantSessionModal.vue b/packages/editor-ui/src/components/AskAssistant/NewAssistantSessionModal.vue index b2496b07f..54b87a83b 100644 --- a/packages/editor-ui/src/components/AskAssistant/NewAssistantSessionModal.vue +++ b/packages/editor-ui/src/components/AskAssistant/NewAssistantSessionModal.vue @@ -29,19 +29,15 @@ const close = () => { const startNewSession = async () => { await assistantStore.initErrorHelper(props.data.context); - telemetry.track( - 'User opened assistant', - { - source: 'error', - task: 'error', - has_existing_session: true, - workflow_id: workflowsStore.workflowId, - node_type: props.data.context.node.type, - error: props.data.context.error, - chat_session_id: assistantStore.currentSessionId, - }, - { withPostHog: true }, - ); + telemetry.track('User opened assistant', { + source: 'error', + task: 'error', + has_existing_session: true, + workflow_id: workflowsStore.workflowId, + node_type: props.data.context.node.type, + error: props.data.context.error, + chat_session_id: assistantStore.currentSessionId, + }); close(); }; diff --git a/packages/editor-ui/src/components/Error/NodeErrorView.vue b/packages/editor-ui/src/components/Error/NodeErrorView.vue index ba9c476a4..7ca1b7d2d 100644 --- a/packages/editor-ui/src/components/Error/NodeErrorView.vue +++ b/packages/editor-ui/src/components/Error/NodeErrorView.vue @@ -433,18 +433,14 @@ async function onAskAssistantClick() { return; } await assistantStore.initErrorHelper(errorPayload); - telemetry.track( - 'User opened assistant', - { - source: 'error', - task: 'error', - has_existing_session: false, - workflow_id: workflowsStore.workflowId, - node_type: node.value.type, - error: props.error, - }, - { withPostHog: true }, - ); + telemetry.track('User opened assistant', { + source: 'error', + task: 'error', + has_existing_session: false, + workflow_id: workflowsStore.workflowId, + node_type: node.value.type, + error: props.error, + }); } diff --git a/packages/editor-ui/src/stores/assistant.store.ts b/packages/editor-ui/src/stores/assistant.store.ts index 229e2227f..75ee335cf 100644 --- a/packages/editor-ui/src/stores/assistant.store.ts +++ b/packages/editor-ui/src/stores/assistant.store.ts @@ -245,10 +245,14 @@ export const useAssistantStore = defineStore(STORES.ASSISTANT, () => { function onEachStreamingMessage(response: ChatRequest.ResponsePayload, id: string) { if (response.sessionId && !currentSessionId.value) { currentSessionId.value = response.sessionId; - telemetry.track('Assistant session started', { - chat_session_id: currentSessionId.value, - task: 'error', - }); + telemetry.track( + 'Assistant session started', + { + chat_session_id: currentSessionId.value, + task: 'error', + }, + { withPostHog: true }, + ); } else if (currentSessionId.value !== response.sessionId) { return; }