mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
feat: add more tracking events (#6866)
Added most tracking events what is missing: - still need a way to track events in blocksuite - some events may not 100% accurate of the one defined in the PRD
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
||||
pushGlobalLoadingEventAtom,
|
||||
resolveGlobalLoadingEventAtom,
|
||||
} from '@affine/component/global-loading';
|
||||
import { mixpanel } from '@affine/core/utils';
|
||||
import { apis } from '@affine/electron-api';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import type { PageRootService, RootBlockModel } from '@blocksuite/blocks';
|
||||
@@ -25,6 +26,11 @@ async function exportHandler({ page, type }: ExportHandlerOptions) {
|
||||
if (editorRoot) {
|
||||
pageService = editorRoot.spec.getService<PageRootService>('affine:page');
|
||||
}
|
||||
mixpanel.track('ShareCreated', {
|
||||
type,
|
||||
segment: 'sharing panel',
|
||||
module: 'export share',
|
||||
});
|
||||
switch (type) {
|
||||
case 'html':
|
||||
await HtmlTransformer.exportDoc(page);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { toast } from '@affine/component';
|
||||
import { useDocMetaHelper } from '@affine/core/hooks/use-block-suite-page-meta';
|
||||
import { FavoriteItemsAdapter } from '@affine/core/modules/properties';
|
||||
import { mixpanel } from '@affine/core/utils';
|
||||
import { WorkspaceFlavour } from '@affine/env/workspace';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
@@ -141,6 +142,11 @@ export function useRegisterBlocksuiteEditorCommands() {
|
||||
label: t['com.affine.header.option.duplicate'](),
|
||||
run() {
|
||||
duplicate(docId);
|
||||
mixpanel.track('DocCreated', {
|
||||
control: 'cmdk',
|
||||
type: 'doc duplicate',
|
||||
category: 'doc',
|
||||
});
|
||||
},
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user