Mixpanel JS installation broke our mail-chimp submit form

  • 24 October 2019
  • 2 replies


We followed the instructions provided by mixpanel to install the tracking script. Unfortunately, this caused our website to take users to the "/undefined" page after they have clicked the "Submit" button on our mailchimp form.

We noticed in the script there are snippets of "undefined"(to be exact, there are 2 of them). We changed the strings by replacing "undefined" with "#thankyou" and it resolved our issue , however it broke the mixpanel tracking script.

Would love to know how we can resolve this and get mixpanel working again without having to make sacrifices to our site or moving away from mixpanel into another analytics platform.

Let me know if you would like more clarification!

I will upload appropriate images for context.

MailChimp Forward should take user to #thankyou but instead gets overwritten by MixPanel's script and takes us to "undefined" instead.

Attempt to fix by replacing "undefined" with "#thankyou" as a result breaking the MixPanel script.

Mixpanel exceptions


2 replies

Userlevel 3

Hey @htjohn,

I am not too familiar with MailChimp but happy to take a look to see what is happening.

While on your website here with the developer inspector in Chrome and I found a couple of things that might be happening.

First thing I noticed in the Mixpanel Library looks a bit different from the one that is mentioned on the Developer Docs for Javascript - some #thankyou changes you made but also it looks like Mixpanel might have a newer library. You might have done this already, but making sure you have the latest library installed is a good gut check to make sure everything is loading well.

I also noticed that there is a few things being called on your <head> tag (Google Analytics, Facebook Pixel, Mixpanel) with their JS and CSS, along with more JS in your HTML body (found and extra HTML tag on line 109).

Totally fine but I am getting the gut feeling that some of these might not be working well together and this is what could be causing Mixpanel or Mailchimp break on your website when you install them. What might help is to separate the JS code and CSS code from each of these (Google Analytics, Facebook Pixel, Mixpanel) into separate CSS and JS directories, so when they load on your website. they do not break each other.

Also, the error message on the console are very helpful. I would also look at the errors that show when you get the 404 on your website - this might give you a hint on what else is happening.

I hope some this helps get to the issue!


Thanks Willy! I appreciate the feedback. I'll work on these points that you mentioned. Will accept the answer If I'm able to get it resolved. 🙂