Mixpanel tracking code does not work

  • 9 August 2019
  • 5 replies


I followed this tutorial
But I didn’t get any data.

You can see I added Mixpanel in my header. The source code is at here

5 replies

Userlevel 1


There could be a couple of things that can cause no data to be sent to your project. I had some trouble when I first started implementing Mixpanel (definitely a learning curve). This article was really helpful for me to troubleshot my implementation when I was not getting data in it

Hope this helps!


Thanks, Frank.

However, when I tried

mixpanel.init("my_token", {debug:true});

it returned undefined.

Also, the Mixpanel Debugger didn't detect anything.

Userlevel 1

hmmm....I went on your Github and cannot find where you are implementing your mixpanel.track() calls. Can you share what file you are doing this on? I might be able to take a closer look from there 🙂


Hi Frank, sorry, I removed since I cannot make it work. But the history PR shows it. The code is just like this

Userlevel 1

@Hongbo-Miao Thanks! I took a look and it looks like you added the Javascript library to your <head> tag in the index.html file. The second step would be to add mixpanel.track() call on your project to send events.

To very quickly capture your first event, you can add this call at the end of your index.html file - right before your closing </body> tag

<script> mixpanel.track("THE NAME OF YOUR EVENT HERE");</script>

This should capture your first event along with the default properties that come with client-side libraries.

I see that you have some javascript files(jsx) where you could do more concentrated event capturing (like create functionality to capture event properties and even people profiles). I think it would be helpful to see their Implementation course to get more information on setting up more tracking in your website. Hopefully this helps get your website tracking running!