Mixpanel
Integrate Mixpanel to track product analytics and user behavior in your documentation, including event tracking, funnel analysis, and user cohorts.
Get your Mixpanel project token
In your Mixpanel project, go to Settings > Project Settings and copy your Project Token.
Your project token will be visible in the browser’s source code. This is normal for client-side analytics and Mixpanel tokens are designed to be safely exposed on the client side.
Create the Mixpanel script
Under your fern directory, create a scripts folder if it doesn’t already exist.
In the scripts folder, create a file named mixpanel.js and add the following script (replace YOUR_PROJECT_TOKEN with your actual project token):
Test your integration
Run fern docs dev and check your browser’s developer tools to confirm the Mixpanel script loads correctly. Navigate through your docs and verify events appear in your Mixpanel dashboard.
For advanced configuration options, see the Mixpanel JavaScript SDK documentation.