Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

chore(core): enable mixpanel ignore_dnt flag (#7841)

forehalodc41ffbe2f09
diff --git a/packages/frontend/core/src/mixpanel/mixpanel.ts b/packages/frontend/core/src/mixpanel/mixpanel.ts
index fe92998507..92c7c7dc8a 100644
--- a/packages/frontend/core/src/mixpanel/mixpanel.ts
+++ b/packages/frontend/core/src/mixpanel/mixpanel.ts
@@ -17,6 +17,7 @@ function createMixpanel() {
track_pageview: true,
persistence: 'localStorage',
api_host: 'https://telemetry.affine.run',
+ ignore_dnt: true,
});
mixpanel = mixpanelBrowser;
} else {
@@ -29,8 +30,7 @@ function createMixpanel() {
const middlewares = new Set<Middleware>();
const wrapped = {
- reset() {
- mixpanel.reset();
+ init() {
mixpanel.register({
appVersion: runtimeConfig.appVersion,
environment: runtimeConfig.appBuildType,
@@ -39,6 +39,10 @@ function createMixpanel() {
isDesktop: environment.isDesktop,
});
},
+ reset() {
+ mixpanel.reset();
+ this.init();
+ },
track(event_name: string, properties?: Record<string, any>) {
const middlewareProperties = Array.from(middlewares).reduce(
(acc, middleware) => {
@@ -80,12 +84,11 @@ function createMixpanel() {
},
};
- wrapped.reset();
-
return wrapped;
}
export const mixpanel = createMixpanel();
+mixpanel.init();
function createProxyHandler() {
const handler = {