From 510bf1b07642dcc32cd2c42b683f568fc5843461 Mon Sep 17 00:00:00 2001 From: David Kircos Date: Tue, 18 Apr 2023 11:14:39 -0600 Subject: [PATCH] add mixpanel people analytics --- src/quadratic/AnalyticsProvider.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/quadratic/AnalyticsProvider.tsx b/src/quadratic/AnalyticsProvider.tsx index 862f0656cc..b8de634daa 100644 --- a/src/quadratic/AnalyticsProvider.tsx +++ b/src/quadratic/AnalyticsProvider.tsx @@ -60,10 +60,18 @@ const loadMixPanelAnalytics = async (user: User | undefined) => { mixpanel.register({ email: user?.email, + distinct_id: user?.sub, }); mixpanel.identify(user?.sub); + mixpanel.people.set_once({ + $distinct_id: user?.sub, + $email: user?.email, + $name: user?.name, + $avatar: user?.picture, + }); + console.log('[Analytics] Mixpanel activated'); };