Solved

Random Issues with CORS When Calling Track Events

  • 10 August 2020
  • 4 replies
  • 221 views

Has anyone started seeing CORS when trying to call mixpanel track events from their website?

 

Here is the console message we’ve started seeing:

Access to XMLHttpRequest at 'https://api-js.mixpanel.com/track/?ip=1&_=XXXXX' from origin 'https://website.com' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values 'https://website.com,*', but only one is allowed.
 

The only thing I can think of that may have caused this is the fact that we started testing a new subdomain that contains mixpanel (to run AB redirect tests). However, we have mixpanel implemented on several other subdomains and have not had any issues up to this point.

icon

Best answer by kyle-fcst 11 August 2020, 00:41

Hi Cherise,

 

Thank you for your answer. I was actually using Chrome, but it appears the problem has resolved itself. It must have been an intermittent issue with the API.

 

Best,

Kyle

View original

4 replies

I’m experiencing this same CORS issue but the mixpanel status page has not reported any incidents.

Userlevel 6
Badge +3

That CORS error can sometimes occur b/c you’re using a browser (most often it occurs with the Firefox browser) that is set to “strict” or you have an adblocker plugin/antivirus plugin that is blocking Mixpanel: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSDidNotSucceed .

Perhaps check your browser settings & disable any plugins to see if you still get the error?

Here is a screenshot from where to adjust this if you are using Firefox:

 

 

Hi Cherise,

 

Thank you for your answer. I was actually using Chrome, but it appears the problem has resolved itself. It must have been an intermittent issue with the API.

 

Best,

Kyle

Userlevel 6
Badge +3

@kyle-fcst — thanks for following up to close the loop! :) 

Reply


Mixpanel