How To Install Mixpanel
Here is how you can install Mixpanel to your project:
- Mixpanel can be installed in a variety of ways based on which underlying technology your project currently uses. It is recommended to visit the mixpanel docs for an in-depth guide for each method. For the purpose of this demo we will be demonstrating the simplest of them all, a vanilla Javascript installation.
- Visit the mixpanel docs and locate the Quickstart section. Under Code, select Javascript to view snippets.
- Copy the code snippet from the code space or using the small copy button.
- Paste this snippet on your webpage before the head tag closes (before </head>).
- Now, head inside mixpanel to retrieve your Project Token. This is found under your Project Settings Overview under Access Keys.
- Within the same head tag, we will be initializing mixpanel and enabling page views tracking. To do so, add the following line of code inside a script tag:
mixpanel.init('PROJECT_TOKEN', {track_pageview: true});
Save these changes in your editor. - Mixpanel is now installed on your project and is being tracked. Visit the mixpanel dashboard to view statistics.