chore: add data import type segment event [INS-3296] (#6765)

* chore: add data import type segment event [INS-3296]

* fix
This commit is contained in:
Filipe Freire 2023-11-08 02:55:22 +00:00 committed by GitHub
parent 4952ff5515
commit d5b8b2d6d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,6 +13,7 @@ import { useFetcher } from 'react-router-dom';
import styled from 'styled-components';
import { isScratchpadProject } from '../../../models/project';
import { SegmentEvent } from '../../analytics';
import {
ImportResourcesActionResult,
ScanForResourcesActionResult,
@ -433,6 +434,11 @@ export const ImportModal: FC<ImportModalProps> = ({
method: 'post',
action: '/import/resources',
});
const type = scanResourcesFetcher.data ? scanResourcesFetcher.data.type?.id || 'unknown' : 'unknown';
window.main.trackSegmentEvent({
event: SegmentEvent.dataImport,
properties: { 'data-import-type': type },
});
}}
/>
) : (