chore(core): replace with new track impl (#7735)

This commit is contained in:
liuyi
2024-08-06 17:15:15 +08:00
committed by GitHub
parent 7373e174db
commit d0f1bb24fd
59 changed files with 647 additions and 821 deletions
@@ -8,7 +8,7 @@ import { EMPTY, mergeMap, switchMap } from 'rxjs';
import { generateSubscriptionCallbackLink } from '../hooks/affine/use-subscription-notify';
import { RouteLogic, useNavigateHelper } from '../hooks/use-navigate-helper';
import { mixpanel } from '../mixpanel';
import { mixpanel, track } from '../mixpanel';
import { AuthService, SubscriptionService } from '../modules/cloud';
import { container } from './subscribe.css';
@@ -70,9 +70,9 @@ export const Component = () => {
: !!subscriptionService.subscription.pro$.value;
if (!subscribed) {
setMessage('Creating checkout...');
mixpanel.track('PlanUpgradeStarted', {
type: plan,
category: recurring,
track.subscriptionLanding.$.$.checkout({
plan: receivedPlan,
recurring: receivedRecurring,
});
try {
const account = authService.session.account$.value;
@@ -7,7 +7,7 @@ import {
import { Header } from '@affine/core/components/pure/header';
import { WorkspaceModeFilterTab } from '@affine/core/components/pure/workspace-mode-filter-tab';
import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
import { mixpanel } from '@affine/core/mixpanel';
import { track } from '@affine/core/mixpanel';
import type { Filter } from '@affine/env/filter';
import { PlusIcon } from '@blocksuite/icons/rc';
import { useService, WorkspaceService } from '@toeverything/infra';
@@ -32,21 +32,12 @@ export const AllPageHeader = ({
const onImportFile = useAsyncCallback(async () => {
const options = await importFile();
if (options.isWorkspaceFile) {
mixpanel.track('WorkspaceCreated', {
page: 'doc library',
segment: 'all page',
module: 'doc list header',
control: 'import button',
type: 'imported workspace',
track.allDocs.header.actions.createWorkspace({
control: 'import',
});
} else {
mixpanel.track('DocCreated', {
page: 'doc library',
segment: 'all page',
module: 'doc list header',
control: 'import button',
type: 'imported doc',
// category
track.allDocs.header.actions.createDoc({
control: 'import',
});
}
}, [importFile]);