Analytics with Mixpanel
To use Mixpanel with nextstarter, first create a Mixpanel account (opens in a new tab) and get your app token.
Then, add the app token to your .env.local
file and your deployment environment:
NEXT_PUBLIC_MIXPANEL_TOKEN=your_token_here
Next, we need to install the Mixpanel packages:
pnpm add --filter web mixpanel-browser
pnpm add --filter web -D @types/mixpanel-node
Finally, we need activate Mixpanel as the analytics provider. To do this, open apps/web/modules/analytics/index.tsx
and change the content to:
export * from './provider/mixpanel';
To customize the Mixpanel configuration, edit the apps/web/modules/analytics/provider/mixpanel/index.tsx
.
Learn more about analytics with Mixpanel in the official documentation (opens in a new tab).
For further instructions, follow the general analytics instructions.