feat(editor): Send template id as string in all telemetry events (#8498)

This commit is contained in:
Milorad FIlipović
2024-01-31 13:34:11 +01:00
committed by GitHub
parent 839dd96c7d
commit 2aed788dc3
6 changed files with 25 additions and 7 deletions

View File

@@ -13,6 +13,7 @@ import { createWorkflowFromTemplate } from '@/utils/templates/templateActions';
import { useExternalHooks } from '@/composables/useExternalHooks';
import { useTelemetry } from '@/composables/useTelemetry';
import { useCredentialSetupState } from '@/views/SetupWorkflowFromTemplateView/useCredentialSetupState';
import { tryToParseNumber } from '@/utils/typesUtils';
export type NodeAndType = {
node: INodeUi;
@@ -200,14 +201,14 @@ export const useSetupTemplateStore = defineStore('setupTemplate', () => {
'User inserted workflow template',
{
source: 'workflow',
template_id: templateId.value,
template_id: tryToParseNumber(templateId.value),
wf_template_repo_session_id: templatesStore.currentSessionId,
},
{ withPostHog: true },
);
telemetry.track('User saved new workflow from template', {
template_id: isNaN(+templateId.value) ? templateId : +templateId.value,
template_id: tryToParseNumber(templateId.value),
workflow_id: createdWorkflow.id,
wf_template_repo_session_id: templatesStore.currentSessionId,
});