feat(core): adjust subscription related mixpanel (#7536)

This commit is contained in:
CatsJuice
2024-07-26 02:49:15 +00:00
parent 549e7befed
commit a714961b20
13 changed files with 169 additions and 92 deletions

View File

@@ -1,6 +1,6 @@
import { useUpgradeNotify } from '@affine/core/components/affine/subscription-landing/notify';
import { mixpanelTrack } from '@affine/core/utils';
import { SubscriptionPlan, SubscriptionRecurring } from '@affine/graphql';
import mixpanel from 'mixpanel-browser';
import { nanoid } from 'nanoid';
import { useCallback, useEffect } from 'react';
import { useSearchParams } from 'react-router-dom';
@@ -130,10 +130,10 @@ export const useSubscriptionNotifyReader = () => {
localStorage.removeItem(localStorageKey);
// mixpanel
mixpanel.track('PlanUpgradeSucceeded', {
segment: 'settings panel',
control: 'plan upgrade action',
plan: plan,
mixpanelTrack('PlanChangeSucceeded', {
category: recurring,
type: plan,
control: 'new subscription',
});
} catch (err) {
console.error('Failed to parse subscription callback link', err);