Unable to use track API due to CORS error

  • 10 June 2020
  • 1 reply

  • New Participant
  • 0 replies

My website has been created using Flutter and is hosted in a subdomain (e.g. and on my frontend I am calling the track endpoint to send data to Mixpanel, unfortunately I get a CORS error like the following:

Access to fetch at '[...]' from origin '' has been blocked by CORS policy: Request header field access-control-allow-origin is not allowed by Access-Control-Allow-Headers in preflight response.


I checked the following support pages


But none helped, how can I fix this problem?


1 reply

Userlevel 5
Badge +3



By chance are you using Firefox to viewing your website when you see the CORS error? Late last year, Firefox started blocking all third party tracking services by default. You can see this in the Firefox security settings:

It is definitely unfortunate that Firefox's new privacy features can block Mixpanel from tracking user activity. Currently, I believe the only way we can work around that is to proxy the tracked data to an internal domain before sending it to Mixpanel. You can do that either through using a server-side implementation or you can use our client-side library to proxy the calls to your own server first before sending the data to Mixpanel using the following code snippet:
mixpanel.init("YOUR TOKEN", { api_host: "" });​. You can read more on this in the following article: Ad Blockers Affect Mixpanel.

We are actively working with to be removed from their tracking protection services repository. Firefox uses's repo to identify what type of tracking info to block. If we are able to be removed from that repo we will be able to continue to track user activity, regarding those users using Firefox, without needing to proxy that data to an internal domain first.